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.

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 this GitHub repository.


Example Input

The algorithms are tested using the Tsukuba stereo image.

Tsukuba Stereo Image


Example Outputs

Here are the resulting disparity maps generated by each method.

Block Matching

Block Matching Disparity Map

Dynamic Programming (Left–Right Axes)

Dynamic Programming Disparity Map 1

Dynamic Programming (Left–Disparity Axes)

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 (Accelerated)

Belief Propagation Disparity Map 1

Belief Propagation (Synchronous)

Belief Propagation Disparity Map 2


More Resources


<
Previous Post
Integrating OpenCV (C++) with Visual Studio 2019
>
Blog Archive
Archive of all previous blog posts