不同相机和畸变模型

相机成像模型

针孔模型(pinhole model)

针孔模型是最常见的相机假设模型,对于空间点P(x,y,z),经过外参T和内参K投影到图像上的点(u,v):

\[\lambda \left[ \begin{matrix} u \\ v \\ 1 \end{matrix}\right] = K [R | t] \left[ \begin{matrix} x \\ y \\ z \\ 1 \end{matrix}\right]\]

全向模型(omnidirectional model)

这类相机有360度FOV或者有超过半球的视野。它们有很高的畸变,不能用传统小孔成像模型来描述。

目前存在几种构建广角相机的方法:

  1. Dioptric camera(折光相机): 使用一组shaped lens(如鱼眼镜头),提供略大于半球的视野。鱼眼相机在2000年左右开始使用

  2. Catadioptric camera(反射折射相机): lens+mirror. 在1990年提出[1]

catadioptric camera 示意图,上方是一个反射镜(可能为双曲线,抛物线,椭圆等),再经过下方一个正常的单孔镜头成像

  1. polydioptric cameras: 多个相机的视野组合,能提供360度视野

用于catadioptric camera的统一模型

Unified projection model for central catadioptric cameras: 在2000由 Geyer and Daniilidis[2] 提出 (后来由 Barreto and Araujo[3] 改进) ,适用于双曲线、抛物线、椭球面的反射镜组成的折反射相机,但不适合鱼眼相机。

model的示意图:

mirror坐标系的中心为\(C\),相机坐标系的中心为\(C_\epsilon\)。两个坐标系的X,Y,Z轴方向一致,只是原点在Z方向有一个偏移\(\epsilon\)

假设P是空间中的一个点,P=(x,y,z)是其在mirror坐标系下的坐标。

(1)将\(P\)投影到单位球面上

\[P_s = \frac{P}{\|P\|} = (x_s, y_s, z_s)\]

(2)将\(P_s\)转移到相机坐标系

\[P_\epsilon= (x_s, y_s, z_s + \epsilon)\]

(3)将\(P_\epsilon\)转移到归一化图像平面

\[M = (x_m, y_m, 1) = (\frac{x_s}{z_s + \epsilon}, \frac{y_s}{z_s + \epsilon}, 1)\]

  1. 将M转移到图像平面

\[p=\left[\begin{matrix} f_x & 0 & u_0 \\ 0 & f_y & v_0 \\ 0 & 0 & 1 \end{matrix}\right] M\]

其中,我们可以得到\(P_s\)关于M的函数:

\[P_s=g(M) \propto \left[ \begin{matrix} x_m \\ y_m \\ 1-\epsilon \frac{x_m^2+y_m^2 +1}{\epsilon+ \sqrt{1+(1-\epsilon^2)(x_m^2+y_m^2)}} \end{matrix} \right]\]

Taylor模型

上述模型可以描述catadioptric camera,但却无法用于精确描述鱼眼相机。这主要是因为三种类型的catadioptric camera可以通过精确的参数函数(抛物线、双曲线、椭圆)来表示,但鱼眼镜头的投影模型因相机而异,并且取决于视场角,没有一个统一的参数化模型。

2006年由Scaramuzza et al. [4,5]提出的Taylor模型统一了catadioptric camera和鱼眼相机模型。它的主要想法为:

对于归一化图像上的点M和鱼眼(镜子)坐标系下的3D点\(P_s\),映射关系为:

\[P_s=g(M)\propto \left[ \begin{matrix} x_m \\ y_m \\ a_0+a_2\rho^2+... +a_N\rho^N \end{matrix} \right]\]

其中\(\rho = \sqrt{x_m^2 +y_m^2}\)

根据多项式的次数不同,该模型可以用来描述perspective camera, fisheye camera, catadioptric camera

畸变模型

Radtan(radial-tangential distortion)

径向畸变切向畸变组合。

径向畸变是由透镜形状引起的畸变,其畸变程度和离光心的距离相关,主要分为枕形畸变和桶型畸变。畸变公式为:

\[\left.\left\{\begin{array}{c}x_{distorted}=x(1+k_1r^2+k_2r^4+k_3r^6)\\\\y_{distorted}=y(1+k_1r^2+k_2r^4+k_3r^6)\end{array}\right.\right.\]

其中\(r^2 = x^2 + y^2\)。对于畸变较小的图像中心区域主要是k1起作用,对于畸变较大的边缘区域主要是k2起作用,普通摄像头用这两个系数就可以很好的进行径向畸变的矫正。对于畸变很大的相机,比如鱼眼镜头可以加入k3进行畸变矫正。

在相机组装过程中由于不能严格使得透镜和成像平面完全平行,这样引起的畸变称为切向畸变

组合起来的公式为:

\[\left.\left\{\begin{array}{l}x_{distorted}=x(1+k_1r^2+k_2r^4+k_3r^6)+2p_1xy+p_2(r^2+2x^2)\\\\y_{distorted}=y(1+k_1r^2+k_2r^4+k_3r^6)+p_1(r^2+2y^2)+2p^2xy\end{array}\right.\right.\]

畸变参数包括\(k_1,k_2,(k_3),p_1,p_2\)

FOV

\[\left.\left\{\begin{array}{l}x_{distorted}=\frac{r_d}{r}x\\\\y_{distorted}=\frac{r_d}{r}y\end{array}\right.\right.\] \[r^2=x^2+y^2\] \[r_d=\frac{1}{\omega}arctan(2 \cdot r \cdot tan(\frac{\omega}{2}))\]

畸变参数\(\omega\)

等距畸变(Equidistant,EQUI)

设相机坐标系下三维点\(P=(x,y,z)\)\(\theta\)为入射角

\[r^2=\frac{x^2}{z^2}+\frac{y^2}{z^2}\] \[\theta=arctan(\frac{\sqrt{x^2+y^2}}{z})=arctan(r)\]

畸变: \[\theta_d=\theta + k_1 \theta^3 + k_2 \theta^5 +k_3 \theta^7 + k_4 \theta^9\]

\[\left.\left\{\begin{array}{l}x_{distorted}=\frac{\theta_d}{r}x\\\\y_{distorted}=\frac{\theta_d}{r}y\end{array}\right.\right.\]

畸变参数\(k_1,k_2,k_3,k_4\)

参考文献

[1] Yagi, Y., Kawato, S. (1990). Panorama scene analysis with conic projection. IEEE International Conference on Intelligent Robots and Systems, Workshop on Towards a New Frontier of Applications

[2] Geyer, C., Daniilidis, K. (2000). A unifying theory for central panoramic systems and practical applications. European Conference on Computer Vision

[3] (Barreto, J.P., Araujo, H.). Issues on the geometry of central catadioptric image formation

[4] Scaramuzza, D., Martinelli, A., Siegwart, R. (2006). A flexible technique for accurate omnidirectional camera calibration and structure from motion. IEEE International Conference on Computer Vision Systems

[5] Scaramuzza, D., Martinelli, A., Siegwart, R. (2006). A toolbox for easy calibrating omnidirectional cameras. IEEE International Conference on In- telligent Robots and Systems


不同相机和畸变模型
https://sisyphus-99.github.io/2024/06/05/不同相机和畸变模型/
Author
sisyphus
Posted on
June 5, 2024
Licensed under