Stereo camera utilise the Monocular Camera model for 2 cameras with known relative position generally rigidly attached to each other.

- Left Camera Matrix:
- Right Camera Matrix: (For simplicity its assumed that the left camera center is the origin of the world coordinate system.) Here are the relative position of the right camera center with respect to the left camera center. In a perfectly rectified and aligned stereo camera rig and where is the physical baseline ie. the distance between the 2 cameras.
Essential Matrix ()
The essential matrix links the points from the left camera to the right camera irrespective of the lens intrinsics, that is
here is the skew-symmetric matrix of the translation vector,
Epipolar Constraints
If and are the normalized coordinates of the same 3D point in the left and right cameras respectively, then
This basically says that the 3 vectors and lie on the same plane, known as the epipolar plane. In the diagram above its the plane created by O1, O2 and P.
Fundamental Matrix ()
The fundamental matrix is the parameters that are used in real life for calculating the estimated position of a feature from one camera to the other. Its a matrix that represents the translation, rotation and the optical properties of both of the cameras in the stereo setup.
Where is the Fundamental Matrix used ?
Suppose the location of a feature in the left camera feed to be . The fundamental matrix is a skew-symmetric matrix.
Given the epipolar constraints we can say that there will be a line in the right camera feed that will be containing the feature. We can calculate
here will be a matrix say that represents the line in the right camera feed. We can then plug in values and check for the respective feature. Therefore your feature matching can now just compare features along the 1D line instead of the entire 2D image.
Note
The line is generally horizontal in a calibrated system, given that the cameras are vertically aligned and are not tilted relative to each other. But in scenarios where the cameras are relatively tilted or vertically misaligned the line can be slanted. This is corrected using a homeographic transformation that reprojects the images in a mathematically perfect virtual space.
Depth Reconstruction
After calibration of the stereo setup the disparity map can be calculated. Disparity map () is the horizontal pixel coordinate distance between matching features.
To convert the disparity back into point clouds we compute the Reprojection Matrix ()
where,
- : Baseline distance.
- : Focal length.
- : Principal point x-coordinate (left camera).
- : Principal point x-coordinate (right camera, usually equal to after rectification).
- To get the final metric 3D point, divide by the homogeneous coordinate : . Because , you can see that depth () is inversely proportional to disparity ().