Computer Vision
Webcam Distance Estimation with Depth Anything V2
A Python computer vision prototype combines object detection and depth estimation to display approximate distances between detected objects in a webcam view.
Illustrative webcam path combining RT-DETR and Depth Anything V2 into a distance overlay. The stored reference scale and assumed camera geometry require setup-specific validation.
The problem
Object boxes show where something appears in an image, but do not tell an application how far away it is. This project explored combining object detection with monocular depth estimation in a repeatable webcam prototype.
What I built
A Python webcam loop combining RT-DETR object detection with Depth Anything V2.
Filtering for the configured person and cup classes, with per-object distance labels in feet.
Spatial calculations and a distance line when exactly two objects are detected.
Project settings and an environment lockfile for repeatable setup.
The diagram follows the running webcam path. A separate navigation module exists in the source but is not called by that loop. Distance conversion uses a stored reference scale and assumed camera geometry; it is not a validated measurement system.
The outcome
The prototype makes estimated spatial relationships visible in a webcam overlay, giving a product team a concrete starting point for camera-specific experiments.
Where this fits
Useful for teams exploring object-aware camera interfaces or depth estimation before investing in calibrated measurements. Share the camera setup, objects and required measurement tolerance to scope the next step through Computer Vision Model Development.
Working on something similar?
Discuss a similar project