Machine Vision Learning Notes (8)--Bouguet stereo correction based on OPENCV
In Machine Vision Learning notes (7)--based on OPENCV's binocular camera calibration, we have calculated the Matrix R and T, which describes the relationship of two {camera} coordinate systems, and the stereo correction is mainly the function of these two parameters. Binocular camera System is the main task is ranging, and parallax distance formula is in the ideal case of binocular system is deduced, so it is necessary to correct the actual binocular system for the ideal binocular system.
Ideal Binocular system : Two camera image plane parallel, optical axis and image plane vertical, pole is wireless distance, point (x0,y0) (X_0,Y_0) corresponding to the line is Y=y0 y=y_0 2.Bouguet correction principle The correction process is shown in the following figure:
During the correction process, the two image planes are rotated by half of R, so that the distortion of the projection is minimized, at this time two camera image plane coplanar (distortion correction after the optical axis is also parallel), but the line is not aligned to the pole is two {camera} coordinate system origin of the connection and the image plane intersection point, To make the poles infinitely far away (if aligned), it is necessary to calculate the Rrect r_{rect} matrix in parallel to the line of the image plane of the two cameras and the origin of the two {camera} coordinate systems so that the Poles are infinitely far:
Set
Rrect=⎡⎣⎢⎢et1et2et3⎤⎦⎥⎥ (1) r_{rect}= \begin{bmatrix} e_1^t\\e_2^t\\e_3^t \end{bmatrix}\tag{1}
Because the image plane eventually runs parallel to the {camera} coordinate system,
e1=t| | t| | (2) e_1=\frac{t}{| | t| |} \TAG{2}
Where T=[tx,ty,tz]t t=[t_x,t_y,t_z]^t, E2 e_2 and E1 e_1 orthogonal, select imagery direction (0,0,1) </