Back to Portfolio

Stereo Depth Estimation — Classical vs Deep Learning

Computer Vision / 3D Vision• 2026

A comparative stereo vision study implementing SAD block matching from scratch and benchmarking it against pretrained RAFT-Stereo on KITTI Stereo 2015.

Stereo Depth Estimation — Classical vs Deep Learning

The Problem

Stereo systems must infer depth from left-right image correspondence while handling textureless surfaces, occlusions, distant objects, and variable scene structure. The project studies the accuracy and failure modes of classical and deep approaches under the same data and metrics.

Problem illustration

The Solution

Built a complete evaluation workflow that starts with a from-scratch SAD matcher, adds consistency checks and parameter studies, then compares its output with RAFT-Stereo disparity and KITTI ground truth using calibrated depth metrics.

Classical SAD Matching

Implemented scanline disparity search with 11×11 patches, a 128-pixel disparity range, winner-takes-all selection, and consistency checks.

RAFT-Stereo Inference

Loaded a pretrained RAFT-Stereo model on CUDA and generated dense disparity predictions for the same stereo pairs.

Metric and Failure Analysis

Measured EPE, KITTI D1, depth RMSE, near/far behavior, texture sensitivity, and representative failure cases.

Architecture

A Colab/GPU-oriented stereo vision notebook with shared data loaders, classical and deep inference branches, calibration-aware depth conversion, and quantitative report generation.

  • Dataset: KITTI Stereo 2015 rectified image pairs and sparse ground truth
  • Classical Model: SAD block matching with 11×11 windows and d_max=128
  • Deep Model: pretrained RAFT-Stereo inference on CUDA
  • Geometry: focal length and baseline calibration for disparity-to-depth conversion
  • Evaluation: EPE, D1, depth RMSE, scene-region breakdowns, histograms, and failure cases

Dataset

Source: KITTI Stereo 2015

  • Rectified left/right stereo images
  • Sparse disparity ground truth
  • Per-frame calibration matrices

Total: 40 evaluated stereo pairs

Split: Stereo pairs selected for classical/deep comparison and failure analysis

Image Size: KITTI rectified road-scene imagery

Training Details

  • framework: Python + PyTorch + OpenCV
  • classicalModel: SAD block matching, block size 11×11, maximum disparity 128
  • deepModel: RAFT-Stereo pretrained inference on CUDA
  • checkpoint: SceneFlow weights fallback used because KITTI weights were unavailable in the notebook run
  • evaluation: 40 KITTI pairs with calibration-aware depth metrics

Results & Analysis

Metrics:

  • overallEPE: SAD 11×11: 3.1682 px | RAFT-Stereo: 1.4192 px
  • kittiD1: SAD 11×11: 15.1894% | RAFT-Stereo: 6.9221%
  • depthRMSE: SAD 11×11: 7.7772 m | RAFT-Stereo: 5.1469 m
  • nearRegionEPE: SAD: 3.7264 px | RAFT-Stereo: 1.4636 px
  • texturelessEPE: SAD: 4.3942 px | RAFT-Stereo: 1.3929 px

Observations:

  • RAFT-Stereo substantially reduced disparity error compared with the from-scratch SAD baseline.
  • The deep model was more robust in textureless regions and near-field scenes.
  • The notebook documents both model quality and failure cases instead of reporting a single aggregate score only.

Future Improvements

  • Repeat the evaluation with KITTI-finetuned RAFT-Stereo weights for a strict benchmark comparison.
  • Add left-right consistency and confidence filtering to the deep model output.
  • Export interactive 3D point clouds and real-time inference profiling.

Technologies Used

PythonPyTorchCUDAOpenCVNumPyPandasMatplotlibSAD Block MatchingRAFT-StereoKITTI Stereo 2015Depth Estimation