FP-Stereo: Hardware-Efficient Stereo Vision for Embedded Applications

Jieru Zhao, Tingyuan Liang, Liang Feng, Wenchao Ding, Sharad Sinha, Wei Zhang, Shaojie Shen

TL;DR

FP-Stereo is an open-source framework that automatically generates high-performance stereo vision pipelines for FPGAs using High-Level Synthesis (HLS). By combining optimized hardware templates with automatic code generation, it achieves a superior balance of accuracy, speed, and power efficiency, outperforming existing libraries like Xilinx’s xfOpenCV by 2x in speed while consuming 40% less energy.

What Problem Does This Paper Address?

Real-time depth estimation is a cornerstone of autonomous navigation for robots and vehicles. The Semi-Global Matching (SGM) algorithm is the industry standard for this task because it offers a sweet spot between the speed of "local" methods and the accuracy of "global" optimization.

However, implementing SGM on embedded hardware like FPGAs is notoriously difficult. Traditional Register-Transfer Level (RTL) design is time-consuming and hard to modify. While High-Level Synthesis (HLS) allows developers to use C/C++ to design hardware, existing HLS libraries often fail to reach the performance of hand-tuned RTL or lack the flexibility to adapt to different hardware budgets. Developers are often forced to choose between a "one-size-fits-all" implementation and months of manual optimization.

Methods

The authors introduce a modular, hardware-efficient library and an automation tool that generates synthesizable C code based on user requirements. Key technical contributions include:

  • Optimized HLS Templates: The library provides multiple methods for each stage of the SGM pipeline (Matching Cost, Aggregation, Disparity Computation, and Refinement), all heavily optimized with HLS pragmas for pipelining and unrolling.
  • Novel Interleaving Strategy: To solve the "loop-carried dependency" problem in cost aggregation—where a calculation depends on the result of the previous pixel—the authors developed an interleaving and reordering strategy. This allows the hardware to process pixels at a rate of one per clock cycle (II=1) without stalling.
  • Memory Optimization: Instead of simple array partitioning, which wastes memory ports, they use data packing to store multiple elements in a single memory instance, reducing BRAM (on-chip memory) usage by 50% (see Figure 4).
  • Auto-computed Data Widths: The tool automatically calculates the minimum bit-width required for intermediate variables based on the chosen algorithm and window size, saving significant logic resources without sacrificing accuracy.
Fig. 1: Diagram of the semi-global matching algorithm.

Datasets

The system was evaluated using the KITTI 2015 dataset, a standard benchmark for autonomous driving. The authors tested 576 different configurations of their library to map out the trade-offs between accuracy, speed, and resource cost.

Key Insights and Ideas

  • Hardware-Algorithm Co-design: The most significant gains come from rethinking the algorithm's data flow to fit FPGA architecture. By interleaving the matching cost volume, they "hide" the latency of dependent calculations.
  • Usability Matters: By providing a consistent interface and automatic code generation, the authors lower the barrier to entry for using FPGAs in computer vision, moving away from "black box" implementations toward a flexible design space.
  • Efficiency through Precision: Standard C types (like 32-bit integers) are overkill for many vision tasks. FP-Stereo’s ability to automatically shrink variables to, say, 11 or 13 bits based on mathematical bounds is a "silent" but powerful optimizer for FPGA resources.
Fig. 2: Optimization with HLS pragmas.

Key Results

FP-Stereo sets a new state-of-the-art for FPGA-based stereo vision:

  • Vs. xfOpenCV: It achieves 6.08% lower error at 2x the speed (161 FPS at full KITTI resolution), while using 30% fewer resources and 40% less energy.
  • Vs. GPUs: While high-end GPUs (like the Titan X) are faster, FP-Stereo is significantly more efficient for embedded use. Compared to an Nvidia Jetson TX2, FP-Stereo-C2 achieves the same accuracy but runs over 5x faster (161 FPS vs 29 FPS).
  • Power Efficiency: FP-Stereo achieves a remarkable 145x better FPS/Watt ratio compared to an embedded ARM CPU.

Limitations and Future Work

The current implementation focuses on 4-path aggregation (scanning in four directions). While this is highly efficient, some high-accuracy applications prefer 8-path or 16-path aggregation to reduce "streaking" artifacts in the disparity map. The authors acknowledge this and plan to support more aggregation directions in the future. Additionally, while the framework automates much of the hardware design, users still need to understand the trade-offs (e.g., Census vs. SAD) to pick the best configuration for their specific needs.

Summary updated

BibTeX
@inproceedings{zhao2020fp,
  author = {Jieru Zhao and Tingyuan Liang and Liang Feng and Wenchao Ding and Sharad Sinha and Wei Zhang and Shaojie Shen},
  title = {{FP-Stereo: Hardware-Efficient Stereo Vision for Embedded Applications}},
  booktitle = {FPL},
  year = {2020},
  doi = {10.1109/fpl50879.2020.00052},
}
Figure