Skip to content

aposb/stereo-algorithms-evolution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Stereo Algorithms Evolution

The basic stereoscopic algorithms have many similarities to each other and can be considered, in a way, that each algorithm is an evolution of another. In this project we created simplified forms of some basic stereoscopic algorithms in MATLAB and Python. The code has been adapted to show the improvement and evolution of an algorithm from the previous one.

Features

Stereo matching algorithms:

  1. Block Matching
  2. Dynamic Programming
  3. Semi-Global Matching
  4. Belief Propagation (Sequential)
  5. Belief Propagation (Synchronous)

All algorithms are implemented in both MATLAB and Python.

The algorithms are optimized for performance using matrix operations and other techniques.

Algorithms

Number Name MATLAB Implementation Python Implementation
1 Block Matching stereo1_BM.m stereo1_BM.py
2 Dynamic Programming stereo2_DP.m stereo2_DP.py
3 Semi-Global Matching stereo3_SGM.m stereo3_SGM.py
4 Belief Propagation (Sequential) stereo4_BP1.m stereo4_BP1.py
5 Belief Propagation (Synchronous) stereo5_BP2.m stereo5_BP2.py

Installation

Download the project as ZIP file, unzip it, and run the scripts.

Python Requirements

  • NumPy
  • Matplotlib
  • OpenCV (opencv-python)

Usage

A stereo matching algorithm works with stereo image pairs to produce disparity maps. This project contains 5 (MATLAB and Python) scripts, each implementing a stereo matching algorithm. The files left.png and right.png contain the stereo image pair used as input. To use a different stereo pair, replace these two images with your own. In this case, you must also adjust the disparity levels parameter in the script you are running. You may optionally modify other parameters as needed. If the input images contain little or no noise, it is recommended not to use the Gaussian filter.

  • The results between MATLAB and Python implementation are similar.

Results

Below are the disparity maps produced from the Tsukuba stereo pair.

Tsukuba Left Tsukuba Right

Block Matching

Block Matching (SAD) Disparity Map

Dynamic Programming

Dynamic Programming (Left-Right) Disparity Map

Semi-Global Matching

Semi-Global Matching Disparity Map

Belief Propagation (Sequential)

Belief Propagation (Sequential) Disparity Map

Belief Propagation (Synchronous)

Belief Propagation (Synchronous) Disparity Map

Links

Project Repository

Related Projects

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Evolution of Basic Stereo Matching Algorithms. From Block Matching and Dynamic Programming to Semi-Global Matching and Belief Propagation. Compare the source code to see the improvements.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors