AI Glossary / Computer vision and multimodal AI / Advanced
Binocular disparity
Definition
Binocular disparity is the difference between the positions of corresponding scene features in two views taken from separated viewpoints. In human vision, the views come from the two eyes. In computer vision, a calibrated stereo-camera pair uses disparity as a geometric cue for estimating depth.
What it means
A nearby object appears to shift relative to the background when viewed from different positions. A stereo system measures corresponding shifts between its images. The relationship to depth depends on camera geometry, not just the size of a visible difference. Matching the correct features is essential: repeated textures, occlusion or weak image detail can produce misleading correspondences. Disparity is an intermediate measurement in a reconstruction process, rather than a depth value by itself.
How it works
For a standard calibrated, rectified stereo pair, corresponding features ideally lie on the same image row. Their horizontal coordinate difference gives disparity d. With matched focal length f in pixels and baseline B in physical units, a simple aligned-camera model gives depth Z=fB/d. Calibration conventions and principal-point offsets must be handled appropriately. Stereo algorithms search for correspondences and often apply consistency checks or regularization. Regions with no reliable match should remain uncertain instead of receiving an unquestioned distance. The human visual system uses disparity alongside other depth cues.
Three practical examples
- A mobile robot uses stereo imagery to estimate visible obstacle depth, checking whether the scene provides reliable matches before using the result for planning.
- A tabletop scanning system reconstructs an object's surface from two calibrated views, combining disparity estimates with known camera geometry.
- A developer inspects a stereo depth map and finds errors on a plain wall. The issue is not necessarily the depth formula; the wall may provide too little texture for reliable correspondence.
Think of it this way
Hold a finger in front of a distant background and alternate which eye is open. The finger seems to move relative to the background because the viewpoints differ. A camera system performs a measured version of this comparison. It must know its geometry and determine which image details correspond before converting the shift into a useful distance estimate.
Worked example
In an original idealized rectified stereo setup, let the focal length be 800 pixels and the baseline be 0.12 meters. A correctly matched point with disparity 40 pixels has depth 800×0.12/40=2.4 meters. If the disparity were 20 pixels, the inferred depth would be 4.8 meters. At 40 pixels, a one-pixel discrepancy gives depths of about 2.34 meters at 41 pixels and 2.46 meters at 39 pixels. These calculations illustrate sensitivity under the simplified geometry. They assume correct calibration, compatible units and a valid match; they do not describe the full uncertainty of a real stereo system.
Illustrative case study
A fictional warehouse team tests a stereo camera for measuring visible shelf distances. It checks the output against independent references and examines failures near shelf edges, reflective packaging and repeated box patterns. The team discovers that some apparently smooth depth regions contain incorrect matches. It introduces confidence handling and evaluates the effect on the downstream measurement task rather than judging only the map's appearance. The report records where depth is unavailable or unreliable. This scenario illustrates an evaluation process and does not claim that a particular camera meets operational accuracy requirements.
Common misconceptions and mistakes
Larger disparity corresponds to smaller depth only within the relevant calibrated geometric convention. Disparity sign and offsets can vary with coordinate choices. Another mistake is mixing focal length in millimeters with disparity in pixels without the required conversion. A zero or invalid disparity should not casually be interpreted as a trustworthy finite distance. Smoothing can hide bad matches rather than correct them. A larger baseline can improve some depth sensitivity but also changes overlap, occlusion and matching difficulty; it is not an unconditional improvement.
Business use
Stereo disparity can support distance sensing and surface reconstruction without requiring every scene to be actively illuminated. Its suitability depends on range, lighting, texture, motion and the required accuracy. A business evaluation should include failure cases, calibration maintenance and the cost of handling uncertain regions. Downstream users need to know whether a value is a supported depth estimate or a filled-in result. The system's useful range and reliability should be established through task-relevant tests rather than assumed from a colorful disparity visualization.
People also ask
Is disparity the same as depth?
No. It is an image-coordinate difference that can be converted to depth using suitable geometry.
Must matching search the entire second image?
Calibration and rectification can constrain the search, often to corresponding rows in a standard stereo setup.
Why do textureless surfaces cause problems?
Many candidate locations can look similar, making correspondence ambiguous.
Check your understanding
Why did halving disparity double the example depth?
Answer: Depth was inversely proportional to disparity in the stipulated geometry.
What units were used for focal length?
Answer: Pixels, matching the disparity units.
Why is a smooth depth map not proof of accuracy?
Answer: Processing can create smooth but incorrect values from bad correspondences.
Related terms
- Correspondence problem
- Epipolar geometry
- Rectification
- Baseline
- Stereo vision
- triangulation
Learn next
Examine a rectified stereo pair and locate a few corresponding features manually. Calculate depth using a known baseline and focal length, then vary disparity slightly. Study occlusion and matching confidence before relying on a dense depth map.
More in Computer vision and multimodal AI
- Bilinear transform - The bilinear transform is a mathematical substitution used to convert a continuous-time filter description into a discrete-time filter.
- Binary decision - A binary decision is a choice between two defined alternatives, such as yes or no, accept or reject, or object present or absent.
- Binary image - A binary image is an image whose pixels have only two possible values.
- Binocular stereopsis - Binocular stereopsis is the perception of depth from differences between the images received by the two eyes.
- Birchfield - Tomasi dissimilarity - Birchfield - Tomasi dissimilarity is a local image-matching cost designed to reduce sensitivity to how a continuous image signal is sampled onto pixel grids.
- Blind deconvolution - Blind deconvolution is the estimation of a sharper underlying signal or image when the blurring process is also unknown or only partly known.
Sources
OpenCV documentation, Depth Map from Stereo Images: https://docs.opencv.org/4.x/dd/d53/tutorial_py_depthmap.html Birchfield and Tomasi, A Pixel Dissimilarity Measure That Is Insensitive to Image Sampling, stereo-matching context: https://ai.stanford.edu/~birch/publications/dissimilarity_pami1998.pdf The depth calculation, finger demonstration and warehouse scenario are original educational illustrations. The numerical formula assumes the stated rectified-camera setup.
Previous: Binding list Next: Binocular stereopsis