# Stereo Depth

## How does stereo depth work?

Stereo depth works like human vision. Two cameras a fixed distance apart (the baseline) capture the same scene, and the camera
measures disparity: how many pixels a point shifts between the left and right images. Close objects shift more, and distant
objects shift less. OAK cameras compute disparity and depth for every pixel on the device, in hardware.

Learn more: [Configuring stereo depth](https://docs.luxonis.com/hardware/platform/depth/configuring-stereo-depth.md) · [Depth
overview](https://docs.luxonis.com/overview/toplevel-features/depth.md)

## How is depth calculated from disparity?

Depth equals focal length (in pixels) multiplied by baseline, divided by disparity (in pixels): `depth = focal_length_px *
baseline / disparity_px`. On an OAK-D, with a 7.5 cm baseline and an 882.5 px focal length at 800P, a disparity of 95 px
corresponds to about 70 cm. Because disparity shrinks as distance grows, depth error grows with distance.

Learn more: [Configuring stereo depth](https://docs.luxonis.com/hardware/platform/depth/configuring-stereo-depth.md)

## What is a stereo baseline and why does it matter?

The baseline is the distance between the two stereo cameras. A wider baseline improves accuracy at long range but pushes the
minimum depth farther out. A narrower baseline works closer to the camera but loses accuracy at range. For this reason, Luxonis
builds OAK models with a 2 cm baseline (OAK-D SR), a 7.5 cm baseline (OAK-D), and a 15 cm baseline (OAK-D LR).

Learn more: [Configuring stereo depth](https://docs.luxonis.com/hardware/platform/depth/configuring-stereo-depth.md) · [Depth
accuracy](https://docs.luxonis.com/hardware/platform/depth/depth-accuracy.md)

## What is the minimum depth an OAK camera can measure?

Minimum depth is set by the maximum disparity the stereo engine can search: `MinZ = focal_length_px * baseline /
max_disparity_px`. For an OAK-D at 800P, standard mode gives about 70 cm. Extended disparity mode searches up to 190 px instead of
95 px, which halves the minimum depth to about 35 cm. Lowering the resolution or using the short-baseline OAK-D SR reduces it
further.

Learn more: [Configuring stereo depth](https://docs.luxonis.com/hardware/platform/depth/configuring-stereo-depth.md)

## How accurate is OAK stereo depth?

Luxonis measures depth accuracy per model on a textured target. The OAK-D stays below 2% absolute error under 4 m and below 4%
from 4 m to 7 m. OAK4-D and OAK4-D Pro stay below 1.5% under 4 m. The OAK-D LR (15 cm baseline) stays below 1.5% out to 7.5 m, and
the OAK-D SR stays below 2% from 30 cm to 1.8 m.

Learn more: [Depth accuracy](https://docs.luxonis.com/hardware/platform/depth/depth-accuracy.md)

## What is the difference between active and passive stereo?

Passive stereo uses only ambient light and relies on scene texture to match pixels between the two cameras. Active stereo adds an
IR laser dot projector that projects thousands of dots onto the scene, giving the matcher texture on blank walls, floors, and
boxes. OAK-D cameras use passive stereo. OAK-D Pro cameras add the dot projector and an IR flood LED for active stereo and night
vision.

Learn more: [IR dot projector](https://docs.luxonis.com/hardware/platform/features/ir-perception/dot-projector.md) · [Flood
IR](https://docs.luxonis.com/hardware/platform/features/ir-perception/flood-ir.md)

## Why is my depth map noisy or full of holes?

Most depth noise comes from low texture. Stereo matching needs visible detail to find the same point in both images, so blank
walls, glossy surfaces, and repetitive patterns produce invalid or noisy depth. To improve depth on OAK cameras, turn on the IR
dot projector (Pro models), enable subpixel mode and the left-right check, apply spatial and temporal filters, or use the
NeuralDepth node on OAK4.

Learn more: [Configuring stereo depth](https://docs.luxonis.com/hardware/platform/depth/configuring-stereo-depth.md) ·
[StereoDepth node](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/stereo_depth.md)

## Can stereo depth cameras see transparent or reflective surfaces?

Stereo depth struggles with glass, mirrors, and shiny metal, because the two cameras see reflections or the background behind the
surface instead of the surface itself. An IR dot projector helps on matte, low-texture surfaces but not on clear glass. On OAK4
cameras, neural stereo with the NeuralDepth node handles low-texture and difficult surfaces better than classical matching.

Learn more: [NeuralDepth node](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/neural_depth.md) · [IR dot
projector](https://docs.luxonis.com/hardware/platform/features/ir-perception/dot-projector.md)

## Does stereo depth work in the dark?

Passive stereo needs light, so a standard OAK-D loses depth in darkness. OAK-D Pro models add an IR dot projector for depth and an
IR flood LED for illuminated mono images, so depth and tracking keep working without visible light. For low-light color imaging,
Luxonis also offers sensors such as the Sony IMX462, for example on the OAK-FFC-IMX462.

Learn more: [Flood IR](https://docs.luxonis.com/hardware/platform/features/ir-perception/flood-ir.md) · [IR dot
projector](https://docs.luxonis.com/hardware/platform/features/ir-perception/dot-projector.md)

## What is subpixel disparity?

Subpixel mode estimates disparity in fractions of a pixel instead of whole pixels, which gives finer depth steps, especially at
long range. On RVC2 OAK cameras, the StereoDepth node supports 3, 4, or 5 fractional bits, producing 754, 1,506, or 3,010 unique
disparity values. On RVC4, subpixel mode always uses 4 fractional bits. Enable subpixel mode when long-range accuracy matters more
than minimum depth.

Learn more: [StereoDepth node](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/stereo_depth.md)

## What is a left-right check in stereo depth?

A left-right check computes disparity twice, from the left image to the right and from the right image to the left, and discards
pixels where the two results disagree. This removes false depth at object edges, where one camera can see background that the
other camera cannot (occlusion). The OAK StereoDepth node has the left-right check built in.

Learn more: [StereoDepth node](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/stereo_depth.md)

## What is neural stereo depth?

Neural stereo uses a neural network, instead of a classical matching algorithm, to estimate depth from a stereo pair. It fills in
depth where classical stereo fails: low-texture surfaces, repetitive patterns, and difficult lighting. Luxonis runs LENS (Luxonis
Edge Neural Stereo) fully on OAK4 cameras through the NeuralDepth node, with model sizes ranging from low-latency nano to
high-resolution extra large.

Learn more: [NeuralDepth node](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/neural_depth.md)

## How does an OAK camera give the 3D position of a detected object?

OAK stereo cameras combine an object detector with the depth map. For each bounding box, the camera takes depth from a region of
interest inside the box, then uses the camera intrinsics to compute X, Y, and Z coordinates in meters. This runs on the device, so
the host receives detections that already include 3D coordinates.

Learn more: [SpatialDetectionNetwork
node](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/spatial_detection_network.md) · [Spatial
perception](https://docs.luxonis.com/overview/toplevel-features/spatial_perception.md)
