Depth Estimation from Images Guide
Turn flat photos into meters per pixel. Depth estimation is the umbrella that splits into stereo, single-image, and filled-sparse methods.
Why Does This Exist?
Robots need meters, not just labels, yet cameras record brightness. Depth estimation exists to bridge that gap in all its forms: stereo vision triangulates from two views, monocular nets regress from one, and completion densifies sparse lidar. This overview maps the family so readers pick the right branch; each branch then gets its own page.
Detail lives in monocular depth estimation, stereo depth estimation, and depth completion. Representation basics are depth maps.
Think of It Like This
Judging distance three ways
Cover one eye and judge by size memory; open both and feel the stereo snap; then tap a cane to fill the gaps. All three give distance, with different guarantees.
One eye is monocular, two eyes are stereo, and the cane is sparse lidar. The analogy stops at learning: people carry size memory while nets need training data for every new domain.
How It Actually Works
Stereo fixes scale through with known baseline . Monocular predicts either metric depth or affine-invariant disparity up to unknown scale and shift , resolved later by median alignment against sparse truth. Completion takes sparse truth plus the image and regresses dense depth with a sparsity-aware encoder. Evaluation reports absolute relative error and root mean square error over valid pixels.
Worked numbers
A pixel with truth m and prediction m gives . Over four pixels with errors , , , m, RMSE is m. Stereo with and m at disparity px gives m exactly, no alignment needed.
Code
def abs_rel(pred: float, gt: float) -> float: return abs(pred - gt) / gt # scale-aware error per pixel
print(abs_rel(4.4, 4.0)) # -> 0.09999999999999987Watch Out For
Comparing metric and affine outputs raw
Affine models output disparity up to scale and shift, so raw numbers look broken against meters. The symptom is near-perfect shapes with absurd AbsRel. Median-align predictions to ground truth before scoring, and never deploy affine depth without a scale source.
The Quick Version
- Depth estimation predicts meters per pixel from images plus optional sparse range.
- Stereo gives metric depth by baseline; monocular gives shape up to scale.
- Completion densifies sparse lidar guided by the image.
- AbsRel and RMSE over valid pixels are the standard scores.
- A m error at m is AbsRel .
- Align affine outputs before comparing or deploying.