Meet YOLO26: next-gen vision AI.
Ultralytics
Back to Ultralytics Glossary

Depth Estimation

Learn how depth estimation adds 3D perspective to computer vision. Explore techniques like monocular depth and stereo vision using Ultralytics YOLO26 models.

Depth estimation is a critical process in computer vision that determines the distance of objects from a camera, effectively adding a third dimension to 2D images. By calculating how far away every pixel in an image is, this technique creates a depth map, a representation where pixel intensity corresponds to distance. This capability mimics human binocular vision, allowing machines to perceive spatial relationships and geometry. It is a cornerstone technology for enabling autonomous systems to navigate safely, understand their environment, and interact with physical objects.

Link to this sectionCore Mechanisms and Techniques#

There are several ways to achieve depth estimation, ranging from hardware-based solutions to purely software-driven approaches using artificial intelligence.

  • Stereo Vision Systems: Similar to human eyes, stereo vision uses two cameras placed side-by-side. Algorithms analyze the slight differences, or disparity, between the left and right images to triangulate distance. This relies heavily on accurate feature matching to identify the same points in both frames.
  • Monocular Depth Estimation: This advanced method estimates depth from a single image. Since a single 2D photo lacks inherent depth data, deep learning models are trained on vast datasets to recognize visual cues like perspective, object size, and occlusion. Modern architectures, such as convolutional neural networks (CNNs), excel at this task, making it possible to derive 3D structure from standard cameras.
  • LiDAR and Time-of-Flight (ToF): Active sensors like LiDAR (Light Detection and Ranging) and Time-of-Flight cameras emit light pulses and measure the time they take to return. These methods generate highly accurate point clouds and are often used to collect ground truth data for training machine learning models.

Link to this sectionReal-World Applications#

The ability to gauge distance is transformative across many industries, powering applications that require spatial awareness.

  • Autonomous Driving: Self-driving cars rely on depth estimation to detect obstacles, measure the distance to other vehicles, and navigate complex road networks safely. It is integral to 3D object detection for identifying pedestrians and cyclists.
  • Robotics and Automation: Robots use depth perception for tasks like path planning and object manipulation. For instance, a warehouse robot needs to know exactly how far away a shelf is to pick up a package without colliding with it.
  • Augmented Reality (AR): To place virtual objects convincingly into a real-world scene, AR devices must understand the 3D geometry of the environment. Depth estimation ensures that virtual characters can hide behind real furniture, a concept known as occlusion handling.

Link to this sectionCode Example: Monocular Depth Estimation#

While specialized depth models exist, you can often infer spatial relationships using object detection bounding boxes as a proxy for distance in simple scenarios (larger boxes often mean closer objects). Here is how to load a model using the ultralytics package to detect objects, which is the first step in many depth-aware pipelines.

from ultralytics import YOLO

# Load the YOLO26 model
model = YOLO("yolo26n.pt")

# Run inference on an image
results = model("path/to/image.jpg")

# Process results
for result in results:
    # Get bounding boxes (xyxy format)
    boxes = result.boxes.xyxy

    # Iterate through detections
    for box in boxes:
        print(f"Detected object at: {box}")

Link to this sectionRelationship to Other Computer Vision Concepts#

It is important to distinguish depth estimation from related terms. While object detection identifies what and where an object is in 2D space (using a bounding box), depth estimation identifies how far away it is (Z-axis). Similarly, semantic segmentation classifies pixels into categories (e.g., road, sky, car), whereas depth estimation assigns a distance value to those same pixels.

Link to this sectionAdvancements in Spatial AI#

Recent progress in generative AI is bridging the gap between 2D and 3D vision. Techniques like Neural Radiance Fields (NeRF) use multiple 2D images to reconstruct complex 3D scenes, relying heavily on underlying depth principles. Furthermore, as model optimization techniques improve, running highly accurate depth estimation on edge AI devices is becoming feasible. This enables real-time spatial computing on hardware as small as drones or smart glasses, facilitated by platforms like the Ultralytics Platform for efficient model training and deployment.

Explore solutions

Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more
Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more
Real-time AI that works with your team

AI in Robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Real-time AI that works with your operation

AI in Automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Real-time AI tailored to your operation

AI in Agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning