Multiple View Geometry in computer vision 学习记录03

 

2.4 A hierarchy of transformations

标题中的关键字是“层级”,因此我们会先见识到多种变换,然后再去了解它们之间的层级关系。书中介绍了多种变换,每种变换都以“群(group)”的方式来定义。

  1. GL(n):the real general linear group on n dimensions(实数的、线性的、n*n、可逆)
  2. PL(n):projective linear group(书中将这是GL(n)的一个“商群”,个人理解就是除以一个实数的缩放因子)
  3. PL(3):projective transformations of the plane n =3(我们前面一直讨论的H)
  4. Affine group:最后一行是 (0,0,1) 的 PL(3)
  5. Euclidean group:左上角2*2矩阵是正交矩阵的 Affine group
  6. Oriented Euclidean group:左上角2*2矩阵行列式为1的Euclidean group

以上我们由一般到特殊感受了一下变换的层级关系,书中讲解的时候则是由特殊到一般进行。书中要我们注意的是:有一些变换并不能构成群!(小白可以百度一下群的定义)

这里的反例就是透视变换。群要求其上的运算满足封闭性,而多次透视变换后结果并不能由一次透视变换得到,而是变成了投影变换。这点需要注意。

  • 不变量(Invariants)

这里书中提了一下一些变换可以从一些“不变量”的角度描述。例如“欧几里得变换”就是旋转和平移,而“相似”则是旋转平移和各向同性缩放。相较之下,欧几里得变换不会使图像缩放,所以两点之间的距离是不变的,距离则是欧几里得变换中的不变量。另外,角度则是这两种变换中共同的不变量。


 

2.4.1 Class I: Isometries 

Isometry是 \mathbf{IR^2} 平面上的变换,这种变换保持了欧氏距离。这里这个单词就意为“等距”,但我觉的这样直译不是很好我就还是用这个单词来表示这样的变换。Isometry的形式如下:

                                                       \begin{pmatrix} x'\\ y'\\ 1 \end{pmatrix}=\begin{bmatrix} \epsilon cos\theta & -sin\theta&t_x \\ \epsilon sin\theta & cos\theta &t_y \\ 0& 0 & 1 \end{bmatrix}\begin{pmatrix} x\\ y\\ 1 \end{pmatrix}

\epsilon 取值为+1或者-1.① \epsilon=1 时,Isometry是“保持方向的(orientation-preserving)”,并且是欧式变换(平移+旋转)。② \epsilon=-1 时,isometry不再是保持方向的,而是翻转方向的(反射变换diag(-1,1,1)就是一个例子)。

Isometry十分十分重要的原因是它可以描述刚体的运动,这对SLAM而言是十分关键的基础知识所以我会特别关注。上面的代数表达可以改的简洁一些:

                                                              \mathbf{x'=H_Ex=}\begin{bmatrix} \mathbf R & \mathbf t\\ \mathbf 0^T&1 \end{bmatrix}\mathbf x

矩阵里只有“1”是一个标量。\mathbf{R} 是2*2的旋转矩阵,并且是正交的(\mathbf{R}^T\mathbf{R=RR}^T=\mathbf I)。\mathbf{t} 是平移向量(2维),\mathbf{0}就是二维的零向量。值得注意的特殊情况是:t是零向量时只有纯旋转,R是单位矩阵时只有纯平移。

关于自由度,我觉得大家能看出来这里其主要作用的只有三个量,因此自由度是3.关于这个自由度可以很直观地理解:我们在平面上摆弄一个东西(除了翻转之外)只能决定移动的下一个位置还有旋转多少度。

还需要提一句,欧式变换也会被成为“位移(displacement)”。

  • 不变量

在Isometry变换之下不变量有三个:两点间长度、两直线间角度面积。这个很直观也就不多加解释了。

  • 群与方向

之前说过 \epsilon 取值为1时(R的行列式为1),isometry是保持方向的。保持方向的isometry可以构成群,而翻转方向的(\epsilon 为-1)isometry不能构成群。这点区别在之后的相似和仿射变换中也存在。

 

2.4.2 Class II: Similarity transformations (similarity)

相似变化我们可以很快理解,因为它只是isometry的小小改进:相似变换是isometry与isotropic scaling的组合。简单来讲就是可以放大缩小的isometry变换。这一点点小改变是通过添加一个标量“s”完成的,其矩阵表示如下:

                                   \begin{pmatrix} x'\\ y'\\ 1 \end{pmatrix}=\begin{bmatrix} s*cos\theta & -s*sin\theta&t_x \\ s* sin\theta & s*cos\theta &t_y \\ 0& 0 & 1 \end{bmatrix}\begin{pmatrix} x\\ y\\ 1 \end{pmatrix}

写成更简洁的形式:

                                                             \mathbf{x'=H_Sx=}\begin{bmatrix} s\mathbf R & \mathbf t\\ \mathbf 0^T&1 \end{bmatrix}\mathbf x

相似变换的自由度大家应该都能想到是4,因为相较于isometry多加了一个缩放因子。计算这个矩阵和计算isometry一样只需要两个点(算上对应的点一共其实是四个点),原因是similarity和isometry自由度都小于等于4,而一个点就能提供两个等式,所以两个点就足够计算出四个参数了。

  • 不变量

同样我们类比着isometry来学。因为添加了缩放,所以相似变换的不变量会少一点:长度和面积都不再是不变量了,只有角度不变。这点我觉得大家学过相似三角形肯定都懂(笑

我们可以无耻的强行再找出一点不变量:比如长度和面积虽然会变,但是它们的比例可以在相似中得到保持。

  • Metric Structure

由于英语和专业知识水平所限我不是很清楚这个小标题是什么意思,直译的话就叫“度量结构”,但我觉得还是记一下英文名好了。书中说“Metric”这个术语会在第十章的重建部分经常提到,所以我们对于这个陌生的概念不用太焦虑。另外,书中说metric structure这个描述意味着这种结构被定义为相似的。我也没有很明白这短短的一个小节,所以对这部分知识我只能说:有缘再见吧~

 

2.4.3 Class III: Affine transformations (affinity)

仿射变换在相似的基础上更近一步:仿射变换是非奇异线性变换+平移。其矩阵表示如下:

                                                     \begin{pmatrix} x'\\ y'\\ 1 \end{pmatrix}=\begin{bmatrix} a_{11} & a_{12}&t_x \\ a_{21} &a_{22} &t_y \\ 0& 0 & 1 \end{bmatrix}\begin{pmatrix} x\\ y\\ 1 \end{pmatrix}

写成块形式:

                                                     \mathbf{x'=H_Ax=}\begin{bmatrix} \mathbf A & \mathbf t\\ \mathbf 0^T&1 \end{bmatrix}\mathbf x

其中A是一个2*2的非奇异矩阵。大家应该能看出来仿射变换的自由度是6,因为放眼望去矩阵里就有六个未知数。为了避免一点误区得说明一下:这里不像原来说点和线的齐次坐标那样只是比例起作用实际自由度要减一,这里不能约!矩阵随便缩放会导致平移向量改变,那这个变化肯定就变了!所以请搞清楚仿射变换的dof是6.明白这点之后我们也自然知道计算这个矩阵只需要三个点(算上变换后的对应点一共六个)。

以上这种表示并不能帮助我们很好地理解仿射变换。为了理解其核心“A”,我们其实可以做一些分解进而明白小矩阵A其实是“旋转+各向异性缩放”:

                                                       \mathbf{A=R(\theta )R(-\phi )DR(\phi )}

其中R都表示相应角度的旋转矩阵。D是一个简单的对角矩阵:

                                                      \mathbf{D=\begin{bmatrix} \lambda _1 &0 \\ 0& \lambda_2 \end{bmatrix}}

至于这个变化怎么来的可以参考这本书的附录,一般情况我觉得这个不需要深究先记下就好了。根据上面这种分解,我们可以做出如下对A的解读(矩阵一般从右往左看):①旋转 φ ;②分别在x,y方向缩放λ1 λ2;③旋转回来(-φ);④再旋转θ。

前面说了A就是“旋转+各向异性缩放”,这里的“各向异性缩放”就是靠前三步来完成的!还是怕和我一样的小白犯一些低级错误,再说一下我个人对各向异性缩放的理解:

  1. 它缩放之前会旋转(虽然之后会转回来但是在转回来之前进行了xy方向不同比例的缩放,所以会有很大影响
  2. 它缩放的时候xy方向缩放程度可以不同

这两个骚操作结合起来就产生了各向异性缩放,导致图像变形,而不像相似变换那样形状不变只是整体的放大或者缩小。

  • 不变量

已经解释过由于各向异性缩放,仿射变换不会像相似那样能保持形状不变。个人认为标志性的直观解释就是:一条很长的水平直线可以变成很短的斜着的直线。所以不变量肯定更少了....但是仍然可以强行找出来一些还是不变的东西:

  1. 平行线(大家都是xy方向同步缩放的,转的角度也一样,平行的线怎么搞也不会相交)
  2. 平行线的长度比例(由于“各向异性”,不同方向的线的长度比保持不了,但平行线的长度比还是不可能变的)
  3. 面积比(不同方向的正方形在各向异性的变化下形状可能不一样了,但是由于大家xy方向拉伸的比例一样所以总的面积上的比例是不会变的,实际上大家的面积都缩放了\lambda _1\lambda _2(就是A的行列式大小))

还有需要说明的是仿射变换和isometry一样有保持方向和翻转方向之分,取决于A行列式的正负。

 

 2.4.4 Class IV: Projective transformations 

投影变换已经在2.3中定义过了,它是齐次坐标下的非奇异线性变换。这里我们再把它写成类似的块形式:

                                                             \mathbf{x'=H_Px=}\begin{bmatrix} \mathbf A & \mathbf t\\ \mathbf v^T&v \end{bmatrix}\mathbf x

这里的向量 \mathbf{v}=(v_1,v_2)^T。其他一些内容我觉得看2.3就够了。然后要注意一点就是在投影空间中投影是否是方向保持的是不可能区分的,这点会在2.6讲。

  • 不变量

仿射中一条线上(或者说平行线间)的长度比是不变的,在投影变换中这一点也不成立了。书中提到的不变量是一条线上长度的交叉比(cross ratio,ratio of ratios),这点会在之后2.5讲。

 

2.4.5 Summary and comparison 

前面我们学了isometry、相似、仿射、投影由易到难四个层次的变换。递进表现为:旋转+平移——缩放——各向异性缩放——与位置相关的缩放。

这里我再根据书中讲的强调一下后两个。仿射中的各向异性缩放表现为:缩放与位置无关,之和方向有关。投影中的缩放表现为同时和位置、方向有关。对于平面上两个正方形,只要它们的姿态(方向)是一致的,那么仿射变换结果一定相同;但是只要如果不在同一个位置或者不是同一个方向,那么两个正方形的投影变换一定不同。这两者区别的关键在于向量v是否为零,书中通过理想点 (x_1,x_2,0)^T 帮助我们看清这一点区别:

首先是理想点的仿射变换:

其次是理想点的投影变换:

可以看到,投影变换能把理想点映射到一个有限点,而这时仿射变换做不到的。这一特点使得投影变换可以对“灭点”建模。(和我之前提的素描透视中的灭点是同一个东西,之后遇到再讨论)

 

2.4.6 Decomposition of a projective transformation 

很有趣的一点是,投影变换可以被拆解成一些列前面提到的变换,具体如下:

大家计算一下就能得到 \mathbf{A=}s\mathbf{RK+tv}^T ,K是上三角矩阵并且行列式归一为1.注意当v不为0是这样分解才是有效的,且这种分解在s大于0时唯一。

其实这个分解的顺序还能反过来如下:

需要注意的是大家可以把这个结果写出了,和前一种分解的结果是不一样的,所以这里符号一样但实际值不同。

讲这个分解方法的原因是,这样分解可以在只需要确定部分变换时使用。这部分会在2.7讨论。

 

2.4.7 The number of invariants 

这一节简单总结一下各变换的不变量,这一节有一点“玄”,大家主要看书,我在这里说一下自己的理解。说到不变量我们自然会想每种变换有多少个不变量。相信大家也有从前面学到这里也有体会,一个不变量的函数肯定也是不变量。比如欧式变换是最特殊的变换,只有旋转和平移所以长度是不变量,那么它肯定能像“更高等级的变换”一样保持住长度比或者交叉比什么的,因为后者这些都是长度的函数而已。所以我们讨论不变量数量的话应该很严格地讨论那些最本质、在函数上独立的不变量。

书中通过一句话就简洁地引出了一条很本质的结论:

函数独立的不变量的数量大于等于结构的自由度减去变换的自由度。

我只能说因为水平和精力所限没有搞懂这句话。不过这句话的思考角度大概就是一个结构提供的已知变量数去除变换需要确定的变量数之后剩下的差不多就是不变量的数。至于为什么是大于等于的且这个结构怎么去定义我确实无法回答,书中也没有论证,不过我斗胆觉得从工程角度来说这个问题应该问题不大所以我们不用太过关心。书中的举了线段的例子也就套了一下这个结论我就不赘述了,感觉意义不大。最后就放上各种变换不变的几何性质总结,注意从上到下是由一般到特殊,随着变换的dof减小,其不变量是越来越多的。


 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
高清非扫描,是文档类的PDF版本,下面附上书的目录 作者: Richard Hartley / Andrew Zisserman 出版社: Cambridge University Press 出版年: 2004-4-19 页数: 670 定价: USD 139.00 1 Introduction – a Tour of Multiple View Geometry 1 1.1 Introduction – the ubiquitous projective geometry 1 1.2 Camera projections 6 1.3 Reconstruction from more than one view 10 1.4 Three-view geometry 12 1.5 Four view geometry and n-view reconstruction 13 1.6 Transfer 14 1.7 Euclidean reconstruction 16 1.8 Auto-calibration 17 1.9 The reward I : 3D graphical models 18 1.10 The reward II: video augmentation 19 PART 0: The Background: Projective Geometry, Transformations and Estimation 23 Outline 24 2 Projective Geometry and Transformations of 2D 25 2.1 Planar geometry 25 2.2 The 2D projective plane 26 2.3 Projective transformations 32 2.4 A hierarchy of transformations 37 2.5 The projective geometry of 1D 44 2.6 Topology of the projective plane 46 2.7 Recovery of affine and metric properties from images 47 2.8 More properties of conics 58 2.9 Fixed points and lines 61 2.10 Closure 62 3 Projective Geometry and Transformations of 3D 65 3.1 Points and projective transformations 65 3.2 Representing and transforming planes, lines and quadrics 66 v vi Contents 3.3 Twisted cubics 75 3.4 The hierarchy of transformations 77 3.5 The plane at infinity 79 3.6 The absolute conic 81 3.7 The absolute dual quadric 83 3.8 Closure 85 4 Estimation – 2D Projective Transformations 87 4.1 The Direct Linear Transformation (DLT) algorithm 88 4.2 Different cost functions 93 4.3 Statistical cost functions and Maximum Likelihood estimation 102 4.4 Transformation invariance and normalization 104 4.5 Iterative minimization methods 110 4.6 Experimental comparison of the algorithms 115 4.7 Robust estimation 116 4.8 Automatic computation of a homography 123 4.9 Closure 127 5 Algorithm Evaluation and Error Analysis 132 5.1 Bounds on performance 132 5.2 Covariance of the estimated transformation 138 5.3 Monte Carlo estimation of covariance 149 5.4 Closure 150 PART I: Camera Geometry and Single View Geometry 151 Outline 152 6 Camera Models 153 6.1 Finite cameras 153 6.2 The projective camera 158 6.3 Cameras at infinity 166 6.4 Other camera models 174 6.5 Closure 176 7 Computation of the Camera Matrix P 178 7.1 Basic equations 178 7.2 Geometric error 180 7.3 Restricted camera estimation 184 7.4 Radial distortion 189 7.5 Closure 193 8 More Single View Geometry 195 8.1 Action of a projective camera on planes, lines, and conics 195 8.2 Images of smooth surfaces 200 8.3 Action of a projective camera on quadrics 201 8.4 The importance of the camera centre 202 8.5 Camera ca Contents vii 8.6 Vanishing points and vanishing lines 213 8.7 Affine 3D measurements and reconstruction 220 8.8 Determining camera calibration K from a single view 223 8.9 Single view reconstruction 229 8.10 The calibrating conic 231 8.11 Closure 233 PART II: Two-View Geometry 237 Outline 238 9 Epipolar Geometry and the Fundamental Matrix 239 9.1 Epipolar geometry 239 9.2 The fundamental matrix F 241 9.3 Fundamental matrices arising from special motions 247 9.4 Geometric representation of the fundamental matrix 250 9.5 Retrieving the camera matrices 253 9.6 The essential matrix 257 9.7 Closure 259 10 3D Reconstruction of Cameras and Structure 262 10.1 Outline of reconstruction method 262 10.2 Reconstruction ambiguity 264 10.3 The projective reconstruction theorem 266 10.4 Stratified reconstruction 267 10.5 Direct reconstruction – using ground truth 275 10.6 Closure 276 11 Computation of the Fundamental Matrix F 279 11.1 Basic equations 279 11.2 The normalized 8-point algorithm 281 11.3 The algebraic minimization algorithm 282 11.4 Geometric distance 284 11.5 Experimental evaluation of the algorithms 288 11.6 Automatic computation of F 290 11.7 Special cases of F-computation 293 11.8 Correspondence of other entities 294 11.9 Degeneracies 295 11.10 A geometric interpretation of F-computation 297 11.11 The envelope of epipolar lines 298 11.12 Image rectification 302 11.13 Closure 308 12 Structure Computation 310 12.1 Problem statement 310 12.2 Linear triangulation methods 312 12.3 Geometric error cost function 313 12.4 Sampson approximation (first-order geometric correction) 314 viii Contents 12.5 An optimal solution 315 12.6 Probability distribution of the estimated 3D point 321 12.7 Line reconstruction 321 12.8 Closure 323 13 Scene planes and homographies 325 13.1 Homographies given the plane and vice versa 326 13.2 Plane induced homographies given F and image correspondences 329 13.3 Computing F given the homography induced by a plane 334 13.4 The infinite homography H∞ 338 13.5 Closure 340 14 Affine Epipolar Geometry 344 14.1 Affine epipolar geometry 344 14.2 The affine fundamental matrix 345 14.3 Estimating FA from image point correspondences 347 14.4 Triangulation 353 14.5 Affine reconstruction 353 14.6 Necker reversal and the bas-relief ambiguity 355 14.7 Computing the motion 357 14.8 Closure 360 PART III: Three-View Geometry 363 Outline 364 15 The Trifocal Tensor 365 15.1 The geometric basis for the trifocal tensor 365 15.2 The trifoc Contents ix 17.3 Quadrilinear relations 418 17.4 Intersections of four planes 421 17.5 Counting arguments 422 17.6 Number of independent equations 428 17.7 Choosing equations 431 17.8 Closure 432 18 N-View Computational Methods 434 18.1 Projective reconstruction – bundle adjustment 434 18.2 Affine reconstruction – the factorization algorithm 436 18.3 Non-rigid factorization 440 18.4 Projective factorization 444 18.5 Projective reconstruction using planes 447 18.6 Reconstruction from sequences 452 18.7 Closure 456 19 Auto-Calibration 458 19.1 Introduction 458 19.2 Algebraic framework and problem statement 459 19.3 Calibration using the absolute dual quadric 462 19.4 The Kruppa equations 469 19.5 A stratified solution 473 19.6 Calibration from rotating cameras 481 19.7 Auto-calibration from planes 485 19.8 Planar motion 486 19.9 Single axis rotation – turntable motion 490 19.10 Auto-calibration of a stereo rig 493 19.11 Closure 497 20 Duality 502 20.1 Carlsson–Weinshall duality 502 20.2 Reduced reconstruction 508 20.3 Closure 513 21 Cheirality 515 21.1 Quasi-affine transformations 515 21.2 Front and back of a camera 518 21.3 Three-dimensional point sets 519 21.4 Obtaining a quasi-affine reconstruction 520 21.5 Effect of transformations on cheirality 521 21.6 Orientation 523 21.7 The cheiral inequalities 525 21.8 Which points are visible in a third view 528 21.9 Which points are in front of which 530 21.10 Closure 531 x Contents 22 Degenerate Configurations 533 22.1 Camera resectioning 533 22.2 Degeneracies in two views 539 22.3 Carlsson–Weinshall duality 546 22.4 Three-view critical configurations 553 22.5 Closure 558

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值