DEV Community

aposb
aposb

Posted on

Stereo Matching Algorithms in MATLAB and Python

Stereo matching is a core problem in computer vision, and performance matters, especially when working with large images or real-time systems. In this post, I’m sharing a set of fast, optimized stereo matching algorithms implemented in MATLAB and Python.


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: Stereo Matching Algorithms in MATLAB

There is also the Python port: Stereo Matching Algorithms in Python


Example Outputs

The algorithms are tested using the Tsukuba stereo image.

Here are the resulting disparity maps generated by each method.

  • Block Matching

Block Matching Disparity Map

  • Dynamic Programming with Left-Right Axes DSI

Dynamic Programming Disparity Map 1

  • Dynamic Programming with Left-Disparity Axes DSI

Dynamic Programming Disparity Map 2

  • Semi-Global Matching

Semi-Global Matching Disparity Map

  • Semi-Global Block Matching

Semi-Global Block Matching Disparity Map

  • Belief Propagation with Accelerated Message Update Schedule

Belief Propagation Disparity Map 1

  • Belief Propagation with Synchronous Message Update Schedule

Belief Propagation Disparity Map 2

There is also a second approach to Belief Propagation with Synchronous Message Update Schedule, which produces the same result.

Top comments (0)