from http://m.blog.csdn.net/blog/wangxiaokun671903/38322771 关于3D 匹配的一个blog: http://blog.csdn.net/wsj998689aa/article/details/44411215
相机成像的模型如下图所示: P为空间中的点,P1和P2是点P在左右像平面上的成像点,f是焦距,OR和OT是左右相机的光心。由下图可见左右两个相机的光轴是平行的。XR和XT是两个成像点在左右两个像面上距离图像左边缘的距离。 
若两个相机已经校正完成即达到极线平行,两条光轴方向也平行。则视差和物体深度的关系式如下: 假设像平面的size为K: x3 = XR - K/2 x4 = K/2 - XT d = x3 + x4 = XR - XT b - XR+ XT 就是上面那个三角形的底边的长度。 下面利用相似三角形公式来得到视差d(=XR -XT)和Z的关系 (1) 可推导到: (2)
证明过程: 已知: 由相似三角形原理:  (1)+(2)有: (5)
其中b1可以用b、XR和XT表示。 
可得(5)式变为(1)式: 。证毕。

由上面两幅图,可知距离像面越近的点,它在左右相机中的视差越大,距离像面越远的点,它在左右相机中的视差越小。 深度Z和视差的关系图如下:

http://blog.csdn.net/tianwaifeimao/article/details/19544861 三维空间中一点p,投影到两个不同的平面I1、I2,投影点分别为p1,p2。 p、p1、p2在三维空间内构成一个平面S。 S与面I1的交线L1过p1点,称之为对应于p2的极线。同理S与I2的交线称之为对应于p1 的极线(对应于左边图像点的极线在右边图像上,右边与之相同)。如图:

极线约束Epipolar constraint 极线几何Epipolar geometry 所谓极线约束就是说同一个点在两幅图像上的映射,已知左图映射点p1,那么右图映射点p2一 定在相对于p1的极线上,这样可以减少待匹配的点数量。 对于极线约束方程可以由以下来表示: 三维向量x和x'存放相关点,F为一个3*3且秩为2的基础矩阵,那么: 
且左右两个平面的两条极线的方程为(注意 ’): 
对于两条直线,以连续点的方式存储:I和I‘分别在左右两幅图像上,若他们俩有对应关系,那么认为他们两条直线之间的点依次的存在对应关系 对于左侧图像中直线I上的一点x,那么对应于右侧图像中直线I’中的点x‘可以按照下面方式求得: 对应于x的极线为I'e,I'e与直线I‘的交点为x对应的点x’因此: 
http://www./article/431969/ 一、对极几何约束基本概念 对极几何中的重要概念(参考下图): 极点:极点elel:右相机坐标原点在左像平面上的像;极点erer:左相机坐标原点在右像平面上的像 极平面:由两个相机坐标原点OlOl、OrOr和物点P组成的平面 级线:极平面与两个像平面的交线,即plelplel和prerprer 级线约束:两极线上点的对应关系 
1. 找到物点P在左像平面上的像点pl; 2. 画出极线plel; 3. 找到极平面Olplel与右像平面的交线,即得极线prer; 4. 像点pl的对应点一定在极线prer上。 知道这一点就行了。这些对应点之间的存在的对应关系:基础矩阵。 参考http://www.cnblogs.com/gemstone/archive/2011/12/20/2294805.html 二、求解基础矩阵和极线求解基础矩阵的方法,有8点算法、LMed算法、RANSAC算法。 




设两摄像头所确定的线为基线,外极线的几何示意图如下:
C1PC2构成了一个平面,和两个相机的像平面各有一条交线,这条交线就是极线。比如图中的P1E1,P2E2。 因此P在这两个像平面上的投影一定是在这两条交线上,这就是极线约束。
基线与像平面I1的焦点E1称为像平面I1的外极点。基线与像平面I2的交点E2称为平面I2的外极点。设空间中有一点P,在I1上的投影为P1,在I2上的投影为P2。将有点P和基线所确定的平面称为外极平面。外极平面与像平面I1的交线P1E1称为极点E1的外极线,外极平面与像平面I2的交线P2E2称为极点E2的外极线。像平面I1上的点P1在平面I2上的对应点一定位于极点E2的外极线上。这一约称为外极线约束。 在平行双目视觉系统中,由于两个摄像头的光轴平行且位于同一水平高度的情况下,两条外极线与水平轴平行且位于同一水平高度,即垂直坐标相同。SIFT特征匹配过程中加入极限约束方法就可以很好的去除误匹配。
Image rectilinear for stereo https://en./wiki/Image_rectification 通过rectilinear把不共面的像平面校正成共面。
 the search space before (1) and after (2) rectification
Stereo vision uses triangulation based on epipolar geometry to determine distance to an object. More specifically, binocular disparity is the process of relating the depth of an object to its change in position when viewed from a different camera, given the relative position of each camera is known. With multiple cameras it can be difficult to find a corresponding point viewed by one camera in the image of the other camera (known as the correspondence problem). In most camera configurations, finding correspondences requires a search in two-dimensions. However, if the two cameras are aligned correctly to be coplanar, the search is simplified to one dimension - a horizontal line parallel to the line between the cameras. Furthermore, if the location of a point in the left image is known, it can be searched for in the right image by searching left of this location along the line, and vice versa (see binocular disparity). Image rectification is an equivalent (and more often used[1]) alternative to perfect camera alignment. Even with high-precision equipment, image rectification is usually performed because it may be impractical to maintain perfect alignment between cameras. Transformation[edit]If the images to be rectified are taken from camera pairs without geometric distortion, this calculation can easily be made with a linear transformation. X & Y rotation puts the images on the same plane, scaling makes the image frames be the same size and Z rotation & skew adjustments make the image pixel rows directly line up[citation needed]. The rigid alignment of the cameras needs to be known (by calibration) and the calibration coefficients are used by the transform.[2] In performing the transform, if the cameras themselves are calibrated for internal parameters, an essential matrix provides the relationship between the cameras. The more general case (without camera calibration) is represented by the fundamental matrix. If the fundamental matrix is not known, it is necessary to find preliminary point correspondences between stereo images to facilitate its extraction.[2] 
|
|