2. 3D射影几何和变换
射影平面的推广,点和线的对偶关系推广到点和平面的对偶关系,定义了三维空间中的无穷远平面π∞\pi_\infinπ∞。
2.1 点和射影变换
三维空间点齐次表达方式为X=(X1,X2,X3,X4)\textbf{X}=(X_1,X_2,X_3,X_4)X=(X1,X2,X3,X4),X4=0X_4=0X4=0的齐次点表示无穷远点;X′=HX\textbf{X}'=\textbf{HX}X′=HX是关于齐次矢量的线性变换,H\textbf{H}H扣除一个全局尺度因子拥有15个自由度;
2.2 平面、直线和二次曲面的表示和变换
在IP3\textbf{IP}^3IP3中,点和平面对偶,它们的表示和推导均与IP2\textbf{IP}^2IP2中点—线对偶类似,直线自对偶;
2.2.1 Planes
在3维空间中,平面π=(π1,π2,π3,π4)⊤\pi=(\pi_1,\pi_2,\pi_3,\pi_4)^\topπ=(π1,π2,π3,π4)⊤具有3自由度,前3个分量对应与欧氏几何中平面法线,n⋅X~+d=0\textbf{n}\cdot\tilde{\textbf{X}}+d=0n⋅X~+d=0,n=(π1,π2,π3)⊤\textbf{n}=(\pi_1,\pi_2,\pi_3)^\topn=(π1,π2,π3)⊤,X~=(X,Y,Z)⊤\tilde{\textbf{X}}=(X,Y,Z)^\topX~=(X,Y,Z)⊤,d=π4d=\pi_4d=π4,d/∥n∥d/\Vert\textbf{n}\Vertd/∥n∥是原点到平面距离;
联合和关联关系:
(1)平面可由一般位置的三个点(线性无关)或一条直线与一个点联合来唯一确定;
(2)两张不同的平面相交于唯一的直线;
(3)三张不同平面相交于唯一的点;
[X1⊤X2⊤X3⊤]π=0→[π1⊤π2⊤π3⊤]X=0\left[ \begin{array}{ccc} \textbf{X}^\top_1\\ \textbf{X}^\top_2\\ \textbf{X}^\top_3\\ \end{array} \right]\pi=0 \rightarrow\left[ \begin{array}{ccc} \pi^\top_1\\ \pi^\top_2\\ \pi^\top_3\\ \end{array} \right]\textbf{X}=0 ⎣⎡X1⊤X2⊤X3⊤⎦⎤π=0→⎣⎡π1⊤π2⊤π3⊤⎦⎤X=0余子式性质:
M=[X,X1,X2,X3]→detM=X1D234−X2D134+X3D124−X4D123=0M=[\textbf{X},\textbf{X}_1,\textbf{X}_2,\textbf{X}_3]\rightarrow\det{M}=X_1D_{234}-X_2D_{134}+X_3D_{124}-X_4D_{123}=0 M=[X,X1,X2,X3]→detM=X1D234−X2D134+X3D124−X4D123=0
π=(D234,−D134,D124,−D123)=[(X~1−X~3)×(X~2−X~3)−X~3T(X~1×X~2)]\pi=(D_{234},-D_{134},D_{124},-D_{123})= \left[ \begin{array}{cc} (\tilde{\textbf{X}}_1-\tilde{\textbf{X}}_3)\times(\tilde{\textbf{X}}_2-\tilde{\textbf{X}}_3)\\ -\tilde{\textbf{X}}_3^T(\tilde{\textbf{X}}_1\times\tilde{\textbf{X}}_2) \end{array} \right] π=(D234,−D134,D124,−D123)=[(X~1−X~3)×(X~2−X~3)−X~3T(X~1×X~2)]射影变换:
X′=HX,π′=H−⊤π\textbf{X}'=H\textbf{X}, {\pi}'=H^{-\top}\pi X′=HX,π′=H−⊤π平面上的点的参数表示:在平面π\piπ上的点X=Mx\textbf{X}=M\textbf{x}X=Mx,其中4×34\times34×3矩阵M\textbf{M}M的列生成π⊤\pi^\topπ⊤的秩为3的零空间,而3维矢量x\textbf{x}x给出平面π\piπ上点的参数表示,MMM不唯一,π=(a,b,c,d)⊤\pi=(a,b,c,d)^\topπ=(a,b,c,d)⊤且aaa非零,M⊤=[p∣I3×3],其中M^\top=[\textbf{p}|I_{3\times3}],其中M⊤=[p∣I3×3],其中p=(−b/a,−c/a,−d/a)p=(-b/a,-c/a,-d/a)p=(−b/a,−c/a,−d/a);
2.2.2 Lines
两点的连接或平面的相交定义一条直线,在3维空间中直线有4个自由度,把直线看作是由它与两正交平面的交点来定义,其中每张平面上的交点由两个参数确定,所以一条直线共有4个自由度;
I.Null-spaceandspanrepresentation:\textbf{I.Null-space and span representation:}I.Null-spaceandspanrepresentation:
这种表示以直观的几何概念为基础,即直线是共线点束或面束(单参数族),把直线表示成两个向量的张成空间:
W=[A⊤B⊤]W= \left[ \begin{array}{c} A^\top\\ B^\top \end{array} \right] W=[A⊤B⊤]
(i) W⊤W^\topW⊤ is the pencil of points λA+μB\lambda{A}+\mu{B}λA+μB on the line.
(ii) The span of the 2-dimensional right null-space of WWW is the pencil of planes with the line as axis.
直线的对偶表达利用相交两平面向量张成的空间:
W∗=[P⊤Q⊤]W^*= \left[ \begin{array}{c} P^\top\\ Q^\top \end{array} \right] W∗=[P⊤Q⊤]
(i) The span of W*T is the pencil of planes λ′P+μ′Q\lambda'P+\mu'Qλ′P+μ′Q on the line as axis.
(ii) The span of the 2-dimensional right null-space of W* is the pencil of points on the line.
The two representations are related by W∗W⊤=WW∗⊤=O2×2W^*W^\top = WW^{*\top}=O_{2\times2}W∗W⊤=WW∗⊤=O2×2(null matrix).
联合和关联关系通过张成的零空间计算:
(i) The plane π\piπ defined by the join of the point X\textbf{X}X and line WWW is obtained from null-space of
M=[WX⊤]M= \left[ \begin{array}{c} W\\ \textbf{X}^\top \end{array} \right] M=[WX⊤]
If the null-space of MMM is 2-dimensional then the line X\textbf{X}X is on WWW, otherwise Mπ=0M\pi=0Mπ=0.
(ii) The point X\textbf{X}X defined by the intersection of the line WWW with the plane π\piπ is obtained from the null-space of
M=[W∗π⊤]M= \left[ \begin{array}{c} W^*\\ \pi^\top \end{array} \right] M=[W∗π⊤]
If the null-space of MMM is 2-dimensional then the line WWW is on π\piπ, otherwise MX=0M\textbf{X}=0MX=0.
II.Plu¨ckermatrices:\textbf{II.Pl{\"u}cker matrices:}II.Plu¨ckermatrices:
Here a line is represented by a 4×44\times44×4 skew-symmetric homogeneous matrix:
L=AB⊤−BA⊤L=AB^\top-BA^\top L=AB⊤−BA⊤
lij=AiBj−BiAjl_{ij}=A_iB_j-B_iA_j lij=AiBj−BiAj
First a few properties of LLL:
(i) LLL has rank 2. Its 2-dimensional null-space is spanned by the pencil of planes with the line as axis (in fact LW∗⊤=0LW^{*\top}=0LW∗⊤=0, with 000 a 4×24\times24×2 null-matrix).
(ii) The representation has the required 4 degrees of freedom for a line. This is accounted as follows: the skew-symmetric matrix has 6 independent non-zero elements, but only their 5 ratios are significant, and furthermore because detL=0detL=0detL=0 the elements satisfy a (quadratic) constraint . The net number of degrees of freedom is then 4.
(iii) The relation L=AB⊤−BA⊤L = AB^\top - BA^\topL=AB⊤−BA⊤ is the generalization to 4-space of the vector product formula l=x×y\textbf{l}=\textbf{x}\times\textbf{y}l=x×y of IP2 for a line l\textbf{l}l defined by two point x\textbf{x}x, y\textbf{y}y all represented by 3-vectors.
(iv) The matrix LLL is independent of the points AAA, BBB used to define it, since if a different point CCC on the line is used, with C=A+μBC=A+\mu{B}C=A+μB, then the resulting matrix is
L^=AC⊤−CA⊤=A(A⊤+μB⊤)−(A+μB)A⊤=AB⊤−BA⊤=L\hat{L}=AC^\top-CA^\top=A(A^\top+\mu{B}^\top) -(A+\mu{B})A^\top=AB^\top-BA^\top=L L^=AC⊤−CA⊤=A(A⊤+μB⊤)−(A+μB)A⊤=AB⊤−BA⊤=L
(v) Under the point transformation X′=HXX'=HXX′=HX, the matrix transforms as L′=HLH⊤L'=HLH^\topL′=HLH⊤, it is a valency-2 tensor.
The matrix L∗L^*L∗ can be obtained directly from LLL by a simple rewrite rule:
L∗=PQ⊤−QP⊤L^*=PQ^\top-QP^\top L∗=PQ⊤−QP⊤
l12:l13:l14:l23:l42:l34=l34∗:l42∗:l23∗:l14∗:l13∗:l12∗l_{12}:l_{13}:l_{14}:l_{23}:l_{42}:l_{34}=l_{34}^*:l_{42}^*:l_{23}^*:l_{14}^*:l_{13}^*:l_{12}^* l12:l13:l14:l23:l42:l34=l34∗:l42∗:l23∗:l14∗:l13∗:l12∗
The correspondence rule is very simple: the indices of the dual and original component always include all the numbers {1, 2, 3, 4}, so if the original is ijijij then the dual is those numbers of {1, 2, 3, 4} which are not ijijij.
联合和关联关系在这个表示法中得到很好的表示:
(i) The plane defined by the join of the point XXX and line LLL is
π=L∗X\pi=L^*X π=L∗X
and L∗X=0L^*X=0L∗X=0, and only if, XXX is on LLL.
(ii) The point defined by the intersection of the line LLL with the plane π\piπ is
X=LπX=L\pi X=Lπ
and Lπ=0L\pi=0Lπ=0 if, and only if, LLL is on π\piπ.
III.Plu¨ckerlinecoordinates:\textbf{III.Pl{\"u}cker line coordinates:}III.Plu¨ckerlinecoordinates:
L={l12,l13,l14,l23,l42,l34}L=\{l_{12},l_{13},l_{14},l_{23},l_{42},l_{34}\} L={l12,l13,l14,l23,l42,l34}
6维向量LLL只有满足下式才能对应3维空间中一条直线,这个约束的几何解释是IP3中的直线定义了IP5中一个(余维数为1)的曲面,它称为Klein二次曲面,约束中的项是Plucker直线坐标的二次函数;
detL=l12l34+l13l42+l14l23=0detL=l_{12}l_{34}+l_{13}l_{42}+l_{14}l_{23}=0 detL=l12l34+l13l42+l14l23=0
Result 1:
Two lines LLL and L^\hat{L}L^ are co-planar (and thus intersect) if and only if (L∣L^)=0(L|\hat{L})=0(L∣L^)=0.
This product appears in a number of useful formulae:
det[A,B,A^,B^]=l12l^34+l^12l34+l13l^42+l^13l42+l14l^23+l^14l23=(L∣L^)=0\det[A,B,\hat{A},\hat{B}]=l_{12}\hat{l}_{34}+\hat{l}_{12}l_{34}+l_{13}\hat{l}_{42}+\hat{l}_{13}l_{42}+l_{14}\hat{l}_{23}+\hat{l}_{14}l_{23}=(L|\hat{L})=0 det[A,B,A^,B^]=l12l^34+l^12l34+l13l^42+l^13l42+l14l^23+l^14l23=(L∣L^)=0
(i) A 6-vector LLL only represents a line in IP3 if (L∣L)=0(L|L)=0(L∣L)=0.(Klein quadric constraint)
(ii) (L∣L^)=det[P,Q,P^,Q^]=0(L|\hat{L})=det[P,Q,\hat{P},\hat{Q}]=0(L∣L^)=det[P,Q,P^,Q^]=0.
(iii) (L∣L^)=(P⊤A)(Q⊤B)−(Q⊤A)(P⊤B)(L|\hat{L})=(P^\top{A})(Q^\top{B})-(Q^\top{A})(P^\top{B})(L∣L^)=(P⊤A)(Q⊤B)−(Q⊤A)(P⊤B).(2-defined-way)
2.2.3 Quadrics and dual quadrics
IP3中二次曲面定义如下,
X⊤QX=0X^\top{Q}X=0 X⊤QX=0
二次曲面的许多性质直接承接二次曲线的性质,重要性质如下:
(1) 一个二次曲面有9个自由度,对应于4×44\times44×4对称矩阵的10个独立元素再因为全局尺度的原因减去一个自由度;
(2) 一般位置上的九个点确定一个二次曲面;
(3) 如果QQQ是奇异的,那么二次曲面是退化的,并可以由较少的点来确定;
(4) 二次曲面定义了点和平面之间的一种配极,类似于二次曲线在点和直线之间定义的配极,平面π=QX\pi=QXπ=QX称为是XXX关于QQQ的极平面,当QQQ为非奇异并且XXX在二次曲面之外时,极平面由过XXX且与QQQ相切的射线组成的锥与QQQ相接触的点来定义,如果XXX在QQQ上,那么QXQXQX是QQQ在点XXX的切平面;
(5) 平面π\piπ与二次曲面QQQ的交线是二次曲线CCC:
X=Mx→X⊤QX=x⊤M⊤QMx→C=M⊤QMX=M\textbf{x}\rightarrow{X}^\top{Q}X=\textbf{x}^\top{M}^\top{Q}M\textbf{x}\rightarrow{C}=M^\top{Q}M X=Mx→X⊤QX=x⊤M⊤QMx→C=M⊤QM
(6) X′=HX→Q′=H−⊤QH−1,Q∗′=HQ∗H⊤X'=HX\rightarrow{Q}'=H^{-\top}QH^{-1},{{Q}^*}'=HQ^*H^\topX′=HX→Q′=H−⊤QH−1,Q∗′=HQ∗H⊤;(对偶二次曲面: π⊤Q∗π=0,Q∗=Q−1\pi^\top{Q}^*\pi=0,Q^*=Q^{-1}π⊤Q∗π=0,Q∗=Q−1)
2.2.4 Classification of quadrics
Q=U⊤DU→Q=H⊤DHQ=U^\top{D}U\rightarrow{Q}=H^\top{D}H Q=U⊤DU→Q=H⊤DH
UUU is a real orthogonal matrix and DDD is a real diagonal matrix, σ(D)\sigma(D)σ(D) is defined to be the number of +1 entries minus the number of -1 entries;
Quadrics fall into two classes - ruled and unruled quadrics. A ruled quadric is one that contains a straight line.
二次曲面可分为直纹二次曲面和非直纹二次曲面,直纹二次曲面拓扑等价于圆环面,非直纹二次曲面等价于球面。
2.3 三次绕线
三次绕线可以看成2D二次曲线的3维类推(从另一个角度,二次曲面也是二次曲线的3维类推)。
二维射影平面的二次曲线参数方程(A是非奇异3×33\times33×3矩阵):
(x1x2x3)=A(1θθ2)=(a11+a12θ+a13θ2a21+a22θ+a23θ2a31+a32θ+a33θ2)\left( \begin{array}{ccc} x_1\\ x_2\\ x_3 \end{array} \right)= A\left( \begin{array}{ccc} 1\\ \theta\\ \theta^2 \end{array} \right)= \left( \begin{array}{ccc} a_{11}+a_{12}\theta+a_{13}\theta^2\\ a_{21}+a_{22}\theta+a_{23}\theta^2\\ a_{31}+a_{32}\theta+a_{33}\theta^2 \end{array} \right) ⎝⎛x1x2x3⎠⎞=A⎝⎛1θθ2⎠⎞=⎝⎛a11+a12θ+a13θ2a21+a22θ+a23θ2a31+a32θ+a33θ2⎠⎞
IP3中三次绕线的参数形式(A是非奇异4×44\times44×4矩阵):
(x1x2x3x4)=A(1θθ2θ3)=(a11+a12θ+a13θ2+a14θ3a21+a22θ+a23θ2+a24θ3a31+a32θ+a33θ2+a34θ3a31+a32θ+a33θ2+a44θ3)\left( \begin{array}{cccc} x_1\\ x_2\\ x_3\\ x_4 \end{array} \right)= A\left( \begin{array}{ccc} 1\\ \theta\\ \theta^2\\ \theta^3 \end{array} \right)= \left( \begin{array}{ccc} a_{11}+a_{12}\theta+a_{13}\theta^2+a_{14}\theta^3\\ a_{21}+a_{22}\theta+a_{23}\theta^2+a_{24}\theta^3\\ a_{31}+a_{32}\theta+a_{33}\theta^2+a_{34}\theta^3\\ a_{31}+a_{32}\theta+a_{33}\theta^2+a_{44}\theta^3\\ \end{array} \right) ⎝⎜⎜⎛x1x2x3x4⎠⎟⎟⎞=A⎝⎜⎜⎛1θθ2θ3⎠⎟⎟⎞=⎝⎜⎜⎛a11+a12θ+a13θ2+a14θ3a21+a22θ+a23θ2+a24θ3a31+a32θ+a33θ2+a34θ3a31+a32θ+a33θ2+a44θ3⎠⎟⎟⎞
三次绕线的性质(ccc为一条非奇异三次绕线):
(1) ccc不整个地包含在IP3的任何一张平面中,而是与一般平面有三个不同的交点;
(2) 三次绕线有12个自由度(矩阵A有15个自由度,减去3是因为参数θ\thetaθ的1D射影变换保持曲线不变);
(3) 曲线过点XXX给ccc增加了两个约束,XXX给出三个独立的比率,θ\thetaθ被消去仅剩2个约束,过一般位置的六点有唯一的三次绕线;
(4) 所有非退化的三次绕线都是射影等价的c(θ)=(1,θ,θ2,θ3)c(\theta)=(1,\theta,\theta^2,\theta^3)c(θ)=(1,θ,θ2,θ3);
(5) 在两视图几何中,三次绕线产生视在同视点,而且在定义摄像机投影矩阵的退化集时担负重要角色;
2.4 变换层次
3维空间变换同样具有相应的2维空间变换的不变量:
射影变换有15个自由度,七个用于相似变换部分(旋转三个,位移三个,均匀缩放一个),五个用于仿射变换部分(两个缩放比和三个旋转角),三个用于射影变换(νt\nu^tνt);
2.4.1 The screw decomposition
Result 2:
任何具体的平移加旋转运动都等价于绕一根转动轴的旋转加沿该转动轴的平移,该转动轴平行于原来的旋转轴。
平移加绕正交轴的旋转运动(称平面运动)等价于仅仅绕某转动轴的旋转:
3D转动分解:
转动分解可以由表示欧式变换的4×44\times44×4矩阵的不动点来确定。
2.5 无穷远平面
在IP3中任何一对平面都相交于一条直线,其中平行平面的相交于无穷远平面π∞=(0,0,0,1)⊤\pi_\infty=(0,0,0,1)^\topπ∞=(0,0,0,1)⊤的直线上;
Result 3:
在射影变换HHH下,无穷远平面π∞\pi_\inftyπ∞是不动平面的充要条件是HHH是一个仿射变换;π∞=(0,0,0,1)⊤\pi_\infty=(0,0,0,1)^\topπ∞=(0,0,0,1)⊤即为重构的仿射性质。
2.6 绝对二次曲线
绝对二次曲线Ω∞\Omega_\inftyΩ∞是在π∞\pi_\inftyπ∞上一条(点)二次曲线:
X12+X22+X32X42}=0\left. \begin{array}{cc} X^2_1+X^2_2+X^2_3\\ X^2_4 \end{array} \right\} =0 X12+X22+X32X42}=0
(X1,X2,X3)I(X1,X2,X3)=0(X_1,X_2,X_3)I(X_1,X_2,X_3)=0 (X1,X2,X3)I(X1,X2,X3)=0
Result 4:
Ω∞\Omega_\inftyΩ∞是对应于矩阵C=IC=IC=I的一条二次曲线,是π∞\pi_\inftyπ∞上由纯虚点组成的一条二次曲线;在射影变换HHH下,绝对二次曲线Ω∞\Omega_\inftyΩ∞是不动二次曲线的充要条件是HHH是相似变换。
Ω∞\Omega_\inftyΩ∞性质:
(1) Ω∞\Omega_\inftyΩ∞在一般相似变换下是集合不动,而不是点点不动的;
(2) 所有的圆交Ω∞\Omega_\inftyΩ∞于两点,这两点是π\piπ的虚圆点;
(3) 所有球面交π∞\pi_\inftyπ∞于Ω∞\Omega_\inftyΩ∞;
cosθ=d1⊤Ω∞d2(d1⊤Ω∞d1)(d2⊤Ω∞d2)\cos\theta=\frac{d^\top_1\Omega_\infty{d}_2}{\sqrt{(d^\top_1\Omega_\infty{d}_1)(d^\top_2\Omega_\infty{d}_2)}} cosθ=(d1⊤Ω∞d1)(d2⊤Ω∞d2)d1⊤Ω∞d2
正交与配极:d1TΩ∞d2=0d^T_1\Omega_\infty{d}_2=0d1TΩ∞d2=0则d1d_1d1和d2d_2d2相垂直,垂直性可由关于Ω∞\Omega_\inftyΩ∞的共轭性来表征,共轭性是射影关系,因此在射影坐标系(由3维欧式空间的射影变换得到)下,如果两个方向关于Ω∞\Omega_\inftyΩ∞共轭,那么彼此相互垂直(Ω∞\Omega_\inftyΩ∞的矩阵在射影坐标系下一般不是III)。
2.7 绝对对偶二次曲面
绝对二次曲线Ω∞\Omega_\inftyΩ∞的对偶是三维空间中一种退化的对偶二次曲面,称为绝对对偶二次曲面Q∞∗Q^*_\inftyQ∞∗,从几何上说Q∞∗Q^*_\inftyQ∞∗由Ω∞\Omega_\inftyΩ∞的切平面组成,因而Ω∞\Omega_\inftyΩ∞是Q∞∗Q^*_\inftyQ∞∗的“边缘”,亦称为边二次曲面。
Q∞∗=[I00⊤0]Q^*_\infty= \left[ \begin{array}{cc} I&0\\ \textbf{0}^\top&0 \end{array} \right] Q∞∗=[I0⊤00]
Q∞∗Q^*_\inftyQ∞∗的包络就是由与绝对二次曲线相切的平面组成,ν\nuν表示无穷远平面的交线:
π=(ν⊤,k)⊤→π⊤Q∞∗π=0→ν⊤ν=0→ν⊤Iν=0\pi=(\nu^\top,k)^\top\rightarrow\pi^\top{Q}^*_\infty\pi=0\rightarrow\nu^\top\nu=0\rightarrow\nu^\top{I}\nu=0 π=(ν⊤,k)⊤→π⊤Q∞∗π=0→ν⊤ν=0→ν⊤Iν=0
Result 5:
在射影变换HHH下,绝对二次曲面Q∞∗Q^*_\inftyQ∞∗不动的充要条件是HHH是相似变换;
无穷远平面π∞\pi_\inftyπ∞是Q∞∗Q^*_\inftyQ∞∗的零矢量;
两张平面π1\pi_1π1和π2\pi_2π2之间的夹角由下式给出:
cosθ=π1⊤Q∞∗π2(π1⊤Q∞∗π1)(π2⊤Q∞∗π2)\cos\theta=\frac{\pi_1^\top{Q}^*_\infty\pi_2}{\sqrt{(\pi_1^\top{Q}^*_\infty\pi_1)(\pi_2^\top{Q}^*_\infty\pi_2)}} cosθ=(π1⊤Q∞∗π1)(π2⊤Q∞∗π2)π1⊤Q∞∗π2
cosθ=n1⊤n2(n1⊤n1)(n2⊤n2)\cos\theta=\frac{n_1^\top{n}_2}{\sqrt{(n_1^\top{n}_1)(n_2^\top{n}_2)}} cosθ=(n1⊤n1)(n2⊤n2)n1⊤n2