Stereo Matching Algorithms in MATLAB and Python
Source: Dev.to
What’s Included
- Block Matching
- Two versions of Dynamic Programming
- Semi‑Global Matching and Semi‑Global Block Matching
- Three versions of Belief Propagation
All algorithms are available in:
- MATLAB:
- Python:
Example Outputs
The algorithms are tested using the Tsukuba stereo image. Below are the resulting disparity maps generated by each method.
Block Matching

Dynamic Programming – Left‑Right Axes DSI

Dynamic Programming – Left‑Disparity Axes DSI

Semi‑Global Matching

Semi‑Global Block Matching

Belief Propagation – Accelerated Message Update Schedule

Belief Propagation – Synchronous Message Update Schedule
