Stereo Matching Algorithm Combining Image Segmentation and Improved Belief Propagation

Guangming LuComputer 2025

Abstract

In this paper, a stereo matching algorithm combining image segmentation and improved belief propagation is presented to address the problems of poor real-time performance, low matching accuracy of weak texture regions, error matches, and disparity holes. The mean shift algorithm is applied to segment the reference image and define the disparity template, which improves the real-time performance of the algorithm and the matching accuracy of the disparity flat regions. The cost value is calculated by the Sum of Absolute Differences (SAD) algorithm to obtain the initial disparity map, followed by occlusion detection via left-right consistency checks. The weighted least squares method calculates parameters for disparity templates, which are then allocated by an improved belief propagation algorithm to obtain the regional optimal disparity plane. Results show that the presented algorithm significantly reduces error match rates in weak texture and occlusion regions while meeting stereo matching requirements.

Introduction

Stereo matching—the process of calculating depth by comparing two slightly offset images—is a cornerstone of computer vision. However, it faces three major hurdles:

  1. Computational Complexity: Global optimization algorithms like Belief Propagation (BP) are highly accurate but notoriously slow because they perform message passing between every single pixel.
  2. Weak Texture Regions: In areas with little visual detail (like a white wall), algorithms struggle to find unique matches, leading to "disparity holes."
  3. Occlusions: Points visible in one camera but hidden in the other create "invalid values" that traditional algorithms often fail to fill realistically.

The authors aim to bridge the gap between the speed of local algorithms and the precision of global ones by shifting the computational focus from individual pixels to segmented regions.

Proposed Methodology

The proposed pipeline moves away from pixel-by-pixel processing toward a region-based approach, as outlined in the flowchart below.

Flowchart of the proposed stereo matching algorithm combining image segmentation and improved belief propagation.

1. Segmentation and Initial Cost

The reference image is first divided into regions of similar color and texture using the Mean Shift algorithm. The core assumption is that pixels within a segment likely belong to the same smooth depth plane. Initial matching costs are calculated using the Sum of Absolute Differences (SAD) with a truncation threshold, providing better robustness against lighting changes than simple Absolute Difference (AD).

2. Occlusion Handling

A left-right consistency check identifies pixels that do not match up between views. These "invalid" points are classified as either occlusions or mismatches.

Conceptual diagrams illustrating (a) occlusion points and (b) mismatch points in the disparity space.

As shown in the diagrams above, occlusion points (a) occur when a surface is hidden in one view, while mismatch points (b) result from incorrect correspondences. These are filled using parabolic fitting to achieve sub-pixel resolution and median filtering to remove noise.

3. Improved Belief Propagation

The core optimization lies in the BP algorithm. Instead of passing messages between millions of pixels, the algorithm passes messages between the segmented regions:

  • Disparity Plane Fitting: Each region is modeled as a mathematical plane ($ax + by + c$) using weighted least squares.
  • Refined Smoothing Term: The energy function considers the distance between neighboring regions and the length of their shared boundaries, effectively suppressing "disparity nulls" and preserving sharp depth discontinuities at object edges.

Experimental Setup and Datasets

The algorithm was evaluated using the industry-standard Middlebury stereo dataset, specifically focusing on four classic image pairs: Tsukuba, Venus, Teddy, and Cones. These datasets provide "ground truth" depth maps, allowing for precise calculation of error rates.

Results and Discussion

The hybrid approach outperformed traditional Dynamic Programming (DP) and standard Belief Propagation (BP) across several metrics:

  • Accuracy: On the "Venus" dataset, the mismatch rate dropped to 0.98%, compared to 11.60% for standard BP and 10.10% for DP.
  • Speed: For the "Teddy" image pair, the proposed algorithm completed in 43.42 seconds, nearly twice as fast as the traditional BP's 83.93 seconds.
  • Visual Quality: Qualitative results show much cleaner edges and fewer "stripe" artifacts (common in DP) or "hollow" spots (common in standard BP).

Conclusion

This paper demonstrates that combining image segmentation with a region-based Belief Propagation framework significantly improves both the speed and accuracy of stereo matching. By treating segments as the primary nodes in the optimization network, the number of nodes drops from hundreds of thousands to a few hundred, drastically reducing time complexity. Future work will focus on further improving real-time performance for robotics applications and testing the algorithm's robustness in high-noise environments.

Summary updated

BibTeX
@inproceedings{lu2025stereo,
  author = {Guangming Lu},
  title = {{Stereo Matching Algorithm Combining Image Segmentation and Improved Belief Propagation}},
  booktitle = {Computer},
  year = {2025},
  doi = {10.52710/cfs.273},
}
Figure