1 | initial version |
Please refer to the following references for more information:
Rectification will make the left and right images fronto-parallel:
Relation between depth of a triangulated point and disparity is the following:
From equation:
you will get [Eq. 1].
In OpenCV notation, depth of a triangulated point is calculated with:
The 4x4
disparity-to-depth mapping matrix Q is:
The relation between 3D point in homogeneous coordinate and disparity is:
Remember that 2D image point expressed in pixel can be converted to meter in the normalized camera frame (Z=1) with:
If left principal point c_x
and right principal point c'_x
are equals, we get the original equation to compute the depth:
Minus sign should come from if you compute d = (u - u')
or d = (u' - u)
.
As everything is in homogeneous coordinate, 3D point is retrieved with: