Stereo Matching from Auto-Labeling to Edge Deployment
A stereo pipeline using teacher-generated disparity labels to train LightStereo, with a FoundationStereo teacher upgrade and ONNX adaptations for RDK X5 integration.

Tools & Skills
- Stereo Matching
- FoundationStereo
- LightStereo
- Auto-Labeling
- ONNX
- UniMatch
- OpenStereo
- Graph Optimization
- RDK X5 Export
Stereo labels for an efficient deployment model
I developed a stereo-matching workflow for the lawn-care robot: generate dense supervision offline, train a smaller LightStereo model, and adapt its export graph for edge integration. Each training sample pairs a left image, a right image, and a disparity target.
The teacher began as UniMatch and was later replaced with FoundationStereo to improve the generated ground-truth labels. These are model-generated training targets, rather than independently measured depth ground truth.
Teacher-generated disparity
The earlier UniMatch labeling implementation processes paired images at 512 × 640, predicts disparity, and restores it to the original image dimensions. It scales disparity values with the horizontal resize ratio before saving NumPy arrays; color visualizations are separate inspection outputs.
The learned quantity is disparity in pixels. Converting it to metric depth requires rectified stereo geometry, camera calibration, and the stereo baseline. A colored disparity image by itself is not a metric distance measurement.
LightStereo training
The OpenStereo implementation loads left/right images and NumPy disparity files through a custom dataset adapter. The reviewed LightStereo-S configuration initializes from KITTI-pretrained weights and uses stereo augmentation, 448 × 512 training crops, and a maximum disparity of 192 pixels.
LightStereo combines image features, a correlation volume, 2D aggregation, disparity regression, and learned context upsampling. Training supervises valid disparity values with Smooth L1 loss on the final prediction and a weighted coarse prediction. Evaluation is configured for end-point error, D1, and pixel-error thresholds.
The teacher and student run separately: knowledge transfers through the saved disparity targets. The teacher is not required during robot inference.
Export for the robot platform
The RDK X5-oriented export path uses a single input tensor with the left image stacked above the right image: 1 × 3 × 1024 × 640 for two 512 × 640 views. The model splits the views internally and outputs a disparity map.
Compatibility changes replace ScatterND-dependent correlation construction and unfold operations with slice, padding, and concatenation operations. The export script produces and checks an opset-11 ONNX model, with an optional simplification step. Context upsampling remains in the forward path.
The linked video shows the wider autonomous lawn-care system. The pipeline makes it possible to improve the offline teacher and regenerate supervision while retaining an efficient deployment model.
Evidence & demonstration
Demos & project media

The stereo-perception deployment shown in the wider autonomous lawn-care robot system.


