Stereo Vision

Stereo vision recovers depth from two calibrated cameras separated by a known baseline bb. Because the relative pose between the cameras is fixed and known, the position of a scene point in one image constrains where it can appear in the other, and the horizontal shift between the two observations encodes metric depth.

Disparity and depth

After rectification (warping both images so that their epipolar lines become the same horizontal scanlines), a 3D point at depth ZZ appears at horizontal pixel coordinates uLu_L and uRu_R in the left and right images. The disparity is

d=uLuR=fxbZd = u_L - u_R = \frac{f_x\, b}{Z}

where fxf_x is the focal length in pixels. Depth is recovered by inverting:

Z=fxbdZ = \frac{f_x\, b}{d}

Given ZZ, the full 3D point follows from the pinhole model: X=(ucx)Z/fxX = (u - c_x) Z / f_x and Y=(vcy)Z/fyY = (v - c_y) Z / f_y.

Depth uncertainty

Differentiating Z(d)Z(d) shows how a matching error δd\delta d (typically a fraction of a pixel) propagates to depth:

δZZ2fxbδd\delta Z \approx \frac{Z^2}{f_x\, b}\, \delta d

Depth error grows quadratically with distance and inversely with baseline. This is the fundamental design trade-off of stereo rigs: a wider baseline improves far-field accuracy but shrinks the overlapping field of view and makes close-range matching harder; a narrow baseline does the opposite. Beyond some range, disparity falls below matching precision and the stereo pair effectively degenerates into a monocular camera.

Stereo matching

Producing a dense disparity map requires finding, for each pixel in the left image, its correspondence along the same scanline in the right image:

Sparse stereo — matching only detected keypoints between the two views — is common in feature-based SLAM (e.g., ORB-SLAM2’s stereo mode), since it avoids the cost of dense matching while still providing metric landmarks.

Stereo vs. monocular vs. RGB-D

Stereo is triangulation with a fixed, factory-calibrated baseline, which is what makes metric scale observable: a monocular camera can only recover geometry up to an unknown scale factor, whereas a stereo rig anchors it in meters. Compared to RGB-D sensors (structured light or time-of-flight), passive stereo works outdoors in sunlight and at longer ranges, but struggles on textureless surfaces where matching has nothing to lock onto.

Why it matters for SLAM

Stereo removes the two hardest problems of monocular SLAM at once: scale ambiguity and initialization. Every stereo frame yields metric 3D landmarks immediately — no motion parallax needed to bootstrap a map — and scale cannot drift because each new frame re-measures it. That is why stereo (and stereo-inertial) configurations are the default in robotics deployments, and why understanding the disparity-depth relationship and its quadratic error growth is essential for choosing baselines and setting reliable-depth thresholds (e.g., the “close vs. far” point distinction in ORB-SLAM2).