Hierarchical Disparity Estimation with Programmable 3D Hardware

Christopher Zach, Horst Bischof, Konrad KarnerDigital 2004

Abstract

This work presents an implementation of a hierarchical disparity estimation algorithm entirely executed on programmable 3D graphics hardware. In contrast to previous hardware-based implementations of computational stereo algorithms, our method calculates disparities either for rectified stereo images or uncalibrated pairs of stereo images without known epipolar geometry. We exploit features of modern graphics hardware to search for correct disparity vectors efficiently. The hierarchical approach increases the speed and the robustness of the algorithm. Additionally, we use bidirectional matching to remove false matches. We observe up to 50 fps for input images with 256x256 pixels resolution on desktop graphics cards and up to 30 fps on mobile 3D hardware.

Introduction

Stereo vision—the process of calculating depth by comparing two slightly different images—is a cornerstone of computer vision but is computationally grueling. In the early 2000s, performing this in real-time on a standard CPU was nearly impossible for high-resolution images. While researchers had begun looking at Graphics Processing Units (GPUs) to accelerate these tasks, most existing methods were rigid. They often required "rectified" images, where cameras are perfectly aligned to restrict the search for matching pixels to a single horizontal line. This paper addresses the challenge of creating a fast, robust algorithm that works on consumer-grade programmable hardware and can handle "unconstrained" stereo pairs where the camera orientation is not perfectly known.

Methodology

The core of the proposed system is a Hierarchical Disparity Estimation algorithm. Rather than searching for matching pixels at full resolution immediately, which is computationally expensive and prone to local minima, the algorithm utilizes an image pyramid approach:

  1. Image Pyramid Construction: The process begins at a coarse resolution (e.g., 32x32 pixels) to find an initial rough disparity map.
  2. Iterative Refinement: This map is upsampled and refined at progressively finer levels. This coarse-to-fine strategy narrows the search area at each level, significantly increasing speed and robustness against noise.
  3. Block Matching: The Sum of Absolute Differences (SAD) is used as the matching cost to identify corresponding pixels between the left and right images.

Hardware-Level Optimizations

To achieve real-time performance on 2004-era GPUs (DirectX 8.1 class), several specialized techniques were employed to treat the GPU as a General-Purpose SIMD (Single Instruction, Multiple Data) processor:

  • Batched Evaluation: By utilizing the four color channels (RGBA) of the GPU, the algorithm evaluates four different disparity hypotheses simultaneously in a single pass.
  • Bilinear Sampling Trick: To accelerate SAD calculations, the researchers leveraged the GPU’s hardware-based bilinear filtering. By sampling at half-pixel offsets, they could fetch and average four pixels in a single texture lookup, reducing the number of lookups for a 4x4 window from 16 to just 4.
  • Hardware Depth Testing: The GPU’s built-in depth buffer (Z-buffer) was repurposed to automatically track and store the minimum error match for each pixel, offloading the comparison logic from the pixel shader.
The bilinear sampling trick utilizes hardware-based filtering to sample four pixels simultaneously, significantly reducing texture lookups during SAD calculation.

Experimental Results

The system was evaluated using the classic Tsukuba dataset, a synthetic textured sphere for 2D search testing, and uncalibrated webcam images.

Performance and Accuracy

On a desktop ATI Radeon 9700 Pro, the implementation reached 50 fps for 256x256 images. Even on mobile hardware, such as the Radeon 9000 Mobility, it maintained a playable 30 fps. For uncalibrated images requiring a full 2D search, the system processed 256x256 pairs in approximately 240ms, enabling interactive applications in unconstrained environments.

Bidirectional Verification

A key feature for improving quality is bidirectional matching. By performing the match from Left-to-Right and then Right-to-Left, the system can identify occlusions—areas visible to only one camera—and discard false matches. This process significantly cleans up the resulting disparity map, as shown in the comparisons below.

Disparity results for the Tsukuba dataset (a). Comparison shows how window size (b vs d) and bidirectional matching (c vs e) affect the density and accuracy of the depth map.

Conclusion

This work demonstrates that programmable 3D hardware can be effectively repurposed for complex computer vision tasks, outperforming contemporary CPU implementations. While the current version relies on grayscale intensity, future improvements could incorporate color information for higher robustness. Additionally, extending the framework to handle epipolar geometry without explicit rectification remains a promising avenue for further research.

Summary updated

BibTeX
@inproceedings{zach2004hierarchical,
  author = {Christopher Zach and Horst Bischof and Konrad Karner},
  title = {{Hierarchical Disparity Estimation with Programmable 3D Hardware}},
  booktitle = {Digital},
  year = {2004},
}
Figure