Skip to content

Latest commit

 

History

History
70 lines (54 loc) · 3.09 KB

README.md

File metadata and controls

70 lines (54 loc) · 3.09 KB

Stereo Disparity: Semi-Global-Matching and Normalized Cross-Correlation

Stereo matching is the problem of finding correspondences between two images that are taken simultaneously from two cameras that are mounted so that they are parallel and separated along their x-axis. The output of stereo matching is a disparity image that, for every pixel in the left image (x), indicates how many pixels to the left its correspondence (x’) is in the right image, giving the disparity (x-x’).

The primary objective of this project is to address the stereo disparity problem by integrating the Normalized Cross-Correlation (NCC) algorithm with the Semi-Global Matching (SGM) algorithm. In addition to this integration, this project focuses on optimising the performance of these algorithms.

One aspect of optimisation involves re-formulating the NCC function for improved efficiency. Furthermore, I implement caching mechanisms to store reused data, thereby reducing computational overhead. For accelerating the SGM algorithm, I employ tensor operations in NumPy rather than conventional pixel-by-pixel iteration. This approach significantly enhances the computational efficiency of the algorithm.

Results

Left Image Right Image
Original
NCC Disparity
SGM Disparity

Runtime Improvement

Standard NCC Accelerated NCC
Runtime 517.14 (s) 255.15 (s)

Usage

The main code is in semi_global_match.ipynb

Dependencies

The project uses python==3.12.2, and the dependencies can be installed by running:

pip install -r requirements.txt

Credits

  • Yu Hsien Chiang, Thomas Chen

References