最全面的homogeneous单应性坐标的定义,以及不同投影,仿射,相似,刚体变换矩阵的关系和自由度分析

本文对图像的投影变换,做了最基础和全面的总结。包括了摄影几何,homogeneous单应性坐标与变换矩阵分析。


学习的一些类容来源于: Photogrammetry - Homogeneous Coordinates.

本文主要分析了homogeneous坐标的定义,应用点。以及不同homogeneous变换的矩阵和自由度。包括了刚体变换,相似变换,仿射变换和射影变换(投影变换)。

1. Homogeneous Coordinate的定义

需要提前了解与掌握homogeneous coordinate的相关信息。homogeneous coordinate具有尺度不变性,主要是为了方便在描述同一直线上的时候,可以用一个尺度 λ \lambda λ 来表示一系列的点。

  1. What is homogeneous coordinate?
    Given a coordinate of a point X X X, if : λ x = X , λ ≠ 0. \lambda x =X, \quad \lambda \neq0. λx=X,λ=0.
    Then, we call this point is in the homogeneous coordinate.
    简明的说,就是在欧式坐标下,多加一个尺度因子,使用一个代表的点,就能够表明在这一条直线上的所有点。
    E u c l i d e a n : x E = [ x , y ] T H o m o g e n e o u s : x H = [ x , y , 1 ] T Euclidean : \quad x_{E}=[x, y]^T \\ Homogeneous: \quad x_H = [x,y,1]^T Euclidean:xE=[x,y]THomogeneous:xH=[x,y,1]T

  2. Why should we use homogeneous coordinates?
    A Euclidean coordinate can only represent one point, where as a homogeneous coordinate can represent one line.
    homogeneous coordinates
    比如,在欧式坐标 E . C . E.C. E.C.的一点 P E P_E PE P E = ( 1 , 2 ) P_E = (1,2) PE=(1,2),那么, P E P_E PE在单应坐标 H . C . H.C. H.C.中,表示为 P E = ( 1 , 2 , 1 ) P_E = (1,2,1) PE=(1,2,1)。由于homogeneous coordinate的性质,以下的等式成立:
    λ [ 1 2 1 ] = [ 1 2 1 ] (1) \lambda \left[ \begin{matrix} 1 \\ 2 \\ 1 \end{matrix} \right] \tag{1}=\left[\begin{matrix} 1\\ 2\\ 1 \end{matrix}\right] λ121=121(1)因此, [ 1 , 2 , 1 ] [1,2,1] [1,2,1]在homogeneous coord空间中,也表示 [ 3 , 6 , 3 ] [3,6,3] [3,6,3].欧式空间中的一点 [ 1 , 2 ] [1,2] [1,2]可以在 H . C . H.C. H.C.空间中表示无数个点,即,一条线。

2. 使用Homogeneous Coordinate的优点

  1. Infinity has better representation in H . C . H.C. H.C. than E . C . . E.C.. E.C..
     In 2D world, infinity representation in E . C . E.C. E.C. is P i n f i n i t y E = [ ∞ , ∞ ] T . P_{infinity_{E}} = [\infty, \infty ]^T. PinfinityE=[,]T. In H . C . H.C. H.C. is P i n f i n i t y H = [ 1 , 2 , 0 ] T . P_{infinity_{H}} = [1, 2 ,0 ]^T. PinfinityH=[1,2,0]T.
     In the H . C . H.C. H.C. representation, if we normalize the coordinate using the last dimension, we get P i n f i n i t y H = [ ∞ , ∞ , 0 ] T . P_{infinity_{H}}=[\infty, \infty, 0]^T. PinfinityH=[,,0]T. The first two dimensions match with the representation in E . C . E.C. E.C.
     Comparing with P i n f i n i t y E P_{infinity_{E}} PinfinityE, clearly, P i n f i n i t y H P_{infinity_{H}} PinfinityH has a significant advantage that the P i n f i n i t y H P_{infinity_{H}} PinfinityH use its first two dimensions to indicate the direction of the infinity. Where as P i n f i n i t y E P_{infinity_{E}} PinfinityE only tell where the infinity is, but never shows the direction.

3. 相机投影的特点

camera projection, 投影变换(projective transformation)是最基础的变换,在homogeneous矩阵中,除了最后一个元素(2D情况下,为第9个元素;3D情况下,为第16个元素)不变,为尺度因子 λ \lambda λ, 矩阵中的其他的所有元素,都是参数可变的。因此,投影变换矩阵的自由度(DOF)最多,为8(2D homogeneous矩阵)或者15(3D homogeneous矩阵)。投影变换,只具有保线性。其他的保角性,平行性,都不再保证。关于这一系列性质的证明,见我提供的证明文件:保角性的证明:https://download.csdn.net/download/qq_32998593/12335191

1. line preserving(保线性)
2. Not angle preserving (非保角性)
3. Not parallel preserving (非保平行性,平行线会交于某个点)
4. No depth, scale information (无深度,尺度信息)

4. H . C . H.C. H.C.在射影几何作用

Using H . C . H.C. H.C. in projective geometry can make the math more easier.
相机投影是将3D世界中的点投影到2D的相机图像平面,在投影过程中,深度信息被丢失。因此,我们无法知道相机图像平面上目标的大小,但由于在单应性 H . C . H.C. H.C.坐标中,具有尺度不变性,这使得我们能够利用 H . C . H.C. H.C.来表示我们的图像的投影。
要想恢复深度,尺度信息,需要额外的3D信息,比如:

  1. 多张图像,不同角度,位置拍摄的;
  2. 相机的参数;
  3. 已知的拍摄物体的大小。

5. Homogeneous Transformation的自由度分析

下面对3D坐标下的变换,进行简单的分析。并分别罗列出不同变换的自由度。

  1. 刚体变换(Rigid Body Transformation)
    最简单的是刚体变换(rigid body transformation)。 包括了平移(translation),旋转(rotation)。因此,旋转包括 X , Y , Z X, Y, Z X,Y,Z 3轴的变换,以及三个方向的平移。因此,自由度,也就是参数的个数为6个。
    T = λ [ R 3 × 3 t 3 × 1 0 1 × 3 1 ] (2) T \tag{2}=\lambda\left[\begin{matrix} R_{3\times 3} &t_{3\times 1}\\ 0_{1\times 3} & 1\\ \end{matrix}\right] T=λ[R3×301×3t3×11](2)
  2. 相似性变换(Similarity Transformation)
    在刚体变换的基础上,加上了尺度因子 m m m。在 3 × 3 3\times 3 3×3的旋转矩阵上,乘上尺度因子。因此,自由度DOF为7。矩阵中右7个未知参数。
    S = λ [ m R 3 × 3 t 3 × 1 0 1 × 3 1 ] (3) S \tag{3}=\lambda\left[\begin{matrix} mR_{3\times 3} &t_{3\times 1}\\ 0_{1\times 3} & 1\\ \end{matrix}\right] S=λ[mR3×301×3t3×11](3)
  3. 仿射变换(Affine Transformation)
    仿射变换具有平行性,即,变换前为平行的线段在仿射变换后,也为平行的。但角度也许会发生变化。在刚体变换的基础上,引入了3个尺度变换因子,3个剪切元素。因此, 3 × 3 3\times3 3×3的旋转矩阵不在保持正交性质。因此自由度DOF为9+3=12。
    A = λ [ N 3 × 3 t 3 × 1 0 1 × 3 1 ] (4) A\tag{4}=\lambda\left[\begin{matrix} N_{3\times3} &t_{3\times 1}\\ 0_{1\times 3} & 1\\ \end{matrix}\right] A=λ[N3×301×3t3×11](4)
  4. 射影(投影)变换(Projective Transformation)
    平行线通过射影变换之后,不再保持平行。除了尺度归一化因子 λ \lambda λ之外,其他所有的元素均为变量。因此,投影变换的自由度DOF为15
    P = λ [ N 3 × 3 t 3 × 1 a 1 × 3 1 ] (5) P\tag{5}=\lambda\left[\begin{matrix} N_{3\times3} &t_{3\times 1}\\ a_{1\times 3} & 1\\ \end{matrix}\right] P=λ[N3×3a1×3t3×11](5)
    其中, a T a^T aT对应于将平行线变为不平行。

6. 变换层次分析

下面是对不同变换之间的关系,进行分析。包括了几种不同的变换,以及他们之间的自由度DOF。包括2D和3D下的不同变换矩阵的自由度。其中,参数的个数也表示自由度。

Projective Transformation: 2D 8/ 3D 15 params
Affine Transformation: 2D 6/ 3D 12 params
Similarity Transformation: 2D 4/ 3D 7 params
Rigid body Transformation: 2D 3/ 3D 6 params
Translation: 2D 2/ 3D 3 params
Rotation: 2D 1/ 3D 3 params

猜你喜欢

转载自blog.csdn.net/qq_32998593/article/details/105579558