Computer visionAdvanced

Semi-Global Block Matching

SGBM estimates stereo disparity by matching local image patches while smoothing the result across paths.

Stereo visionSGBMOpenCVDepth

Site connection

The depth estimation project used OpenCV and SGBM to build stereo disparity maps.

Visual model

Disparity changes with correspondence

The demo compresses the core idea: matched points shift more when the object is closer.

Interactive

Larger disparity means a closer object

Left camera
Right camera

Estimated depth index: 43. The exact unit depends on focal length and baseline calibration.

Block Matching

The algorithm searches for similar patches between the left and right camera images. The horizontal offset between a matching pair becomes disparity.

Semi-Global Smoothing

Pure local matching is noisy. SGBM adds penalties so neighboring disparities prefer to vary smoothly unless image evidence says otherwise.

Common Pitfalls

  • Expecting good matches on blank walls.
  • Using unrectified camera images.
  • Over-smoothing real depth discontinuities.

Quick check

Quiz

What does stereo block matching try to find?
  1. Similar patches across left and right images
  2. The fastest CPU core
  3. A language token
  4. Only the image center

Disparity comes from matching corresponding visual patches.

Sources and Further Reading

Related Explainers