各相机模型(针孔+鱼眼)综述

Overview

欢迎访问 持续更新:https://cgabc.xyz/posts/c60702bf/

Lens Projections

  • Perspective and fisheye imaging process

Optics: Terminology

  • Dioptric: All elements are refractive (lenses)
  • Catoptric: All elements are reflective (mirrors)
  • Catadioptric: Elements are refractive and reflective (mirrors + lenses)

Papers

  • Straight Lines Have to be Straight: Automatic Calibration and Removal of Distortion from Scenes of Structured Environments
  • A Generic Camera Model and Calibration Method for Conventional, Wide-Angle, and Fish-Eye Lenses
  • Single View Point Omnidirectional Camera Calibration from Planar Grids

Related Code

  • Supported models in Kalibr

  • Distortion Models in ROS (distortion_models.h)

    • plumb_bob: a 5-parameter polynomial approximation of radial and tangential distortion
    • rational_polynomial: an 8-parameter rational polynomial distortion model
    • equidistant (lunar)
  • hengli/camodocal

    • Pinhole camera model
    • Unified projection model
    • Equidistant fish-eye model
  • uzh-rpg/rpg_vikit/vikit_common: support pinhole, atan and omni camera

  • ethz-asl/aslam_cv2: support pinhole and unified peojection and radtan, fisheye and equidistant distortion

  • cggos/okvis_cg: support pinhole peojection and radtan and equidistant distortion

  • ptam_cg/src/ATANCamera.cc: support ATAN camera model

Pinhole camera

  • pinhole model (rectilinear projection model) + radial-tangential distortion

The Pinhole camera model is the most common camera model for consumer cameras. In this model, the image is mapped onto a plane through perspective projection. The projection is defined by the camera intrinsic parameters such as focal length, principal point, aspect ratio, and skew.

Fisheye camera

OpenCV fisheye camera model

  • pinhole model (rectilinear projection model) + fisheye distortion

The Fisheye camera model is a camera model utilized for wide field of view cameras. This camera model is neccessary because the pinhole perspective camera model is not capable of modeling image projections as the field of view approaches 180 degrees.

Given a point X = [ x c y c z c ] X=[x_c \quad y_c \quad z_c] X=[xcyczc] from the camera z c = 1 z_c=1 zc=1 plane in camera coordinates, the pinhole projection is:

{ r = x c 2 + y c 2 θ = a t a n 2 ( r , ∣ z c ∣ ) = a t a n 2 ( r , 1 ) = a t a n ( r ) \begin{cases} r = \sqrt{x_c^2 + y_c^2} \\ \theta = atan2(r, |z_c|) = atan2(r, 1) = atan(r) \end{cases} {r=xc2+yc2 θ=atan2(r,zc)=atan2(r,1)=atan(r)

in another way

f = r ′ ⋅ t a n ( θ ) where r ′ = u 2 + v 2 f = r' \cdot tan(\theta) \quad \text{where} \quad r' = \sqrt{u^2 + v^2} f=rtan(θ)wherer=u2+v2

fisheye distortion:

θ d = θ ( 1 + k 1 ⋅ θ 2 + k 2 ⋅ θ 4 + k 3 ⋅ θ 6 + k 4 ⋅ θ 8 ) \theta_d = \theta (1 + k1 \cdot \theta^2 + k2 \cdot \theta^4 + k3 \cdot \theta^6 + k4 \cdot \theta^8) θd=θ(1+k1θ2+k2θ4+k3θ6+k4θ8)

The distorted point coordinates are

{ x d = θ d ⋅ x c r y d = θ d ⋅ y c r \begin{cases} x_d = \frac{\theta_d \cdot x_c} {r} \\ y_d = \frac{\theta_d \cdot y_c} {r} \end{cases} {xd=rθdxcyd=rθdyc

convert into pixel coordinates, the final pixel coordinates vector

{ u = f x ( x d + α y d ) + c x v = f y ⋅ y d + c y \begin{cases} u = f_x (x_d + \alpha y_d) + c_x \\ v = f_y \cdot y_d + c_y \end{cases} {u=fx(xd+αyd)+cxv=fyyd+cy

write in matrix form

[ u v 1 ] = [ f x α c x 0 f y c y 0 0 1 ] [ x d y d 1 ] \begin{aligned} \left[\begin{array}{c}u\\v\\1\end{array}\right] = \left[\begin{array}{ccc} f_x & \alpha & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{array}\right] \left[\begin{array}{c}x_d\\y_d\\1\end{array}\right] \end{aligned} uv1 = fx00αfy0cxcy1 xdyd1

ATAN model

This is an alternative representation for camera models with large radial distortion (such as fisheye cameras) where the distance between an image point and principal point is roughly proportional to the angle between the 3D point and the optical axis. This camera model is first proposed in Straight Lines Have to be Straight: Automatic Calibration and Removal of Distortion from Scenes of Structured Environments.

Given a point X = [ x c y c z c ] X=[x_c \quad y_c \quad z_c] X=[xcyczc] from the camera z c = 1 z_c=1 zc=1 plane in camera coordinates, the pinhole projection is:

r = x c 2 + y c 2 z c 2 = x c 2 + y c 2 r = \sqrt{\frac{x_c^2 + y_c^2}{z_c^2}} = \sqrt{x_c^2 + y_c^2} r=zc2xc2+yc2 =xc2+yc2

FOV distortion:

r d = 1 ω a r c t a n ( 2 ⋅ r ⋅ t a n ( ω 2 ) ) r_d = \frac{1}{\omega}arctan( 2 \cdot r \cdot tan(\frac{\omega}{2}) ) rd=ω1arctan(2rtan(2ω))

where ω \omega ω is the FOV distortion coefficient

The distorted point coordinates are

{ x d = r d r ⋅ x c y d = r d r ⋅ y c \begin{cases} x_d = \frac{r_d}{r} \cdot x_c \\ y_d = \frac{r_d}{r} \cdot y_c \end{cases} {xd=rrdxcyd=rrdyc

convert into pixel coordinates, the final pixel coordinates vector

[ u v 1 ] = [ f x 0 c x 0 f y c y 0 0 1 ] [ x d y d 1 ] \begin{aligned} \left[\begin{array}{c}u\\v\\1\end{array}\right] = \left[\begin{array}{ccc} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{array}\right] \left[\begin{array}{c}x_d\\y_d\\1\end{array}\right] \end{aligned} uv1 = fx000fy0cxcy1 xdyd1

Equidistant fish-eye model

Omnidirectional Camera

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

晨光ABC

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值