Depth Settings

Open in ClaudeOpen in ChatGPT

sl::InitParameters Depth Parameters

For more information on these parameters, see the API documentation page.

Depth Mode

Check this page to get more insights about the currently available depth modes for the ZED cameras.

Depth Range

Depth range corresponds to the minimum and maximum distance at which the depth of an object can be estimated.

Depth Range by Camera Model

Below are the typical depth ranges and focal lengths for each ZED camera model:

ZED Mini
Focal Length3mm
Max Depth Range0.1m to 15m (0.3ft to 49ft)
Ideal Depth Range0.1m to 9m (0.3ft to 13.1ft)

Minimum Range

You can adjust the minimum detectable depth by setting depth_minimum_distance in InitParameters. Lowering this value allows the camera to estimate depth for objects closer to the lens, within the hardware’s supported range.

1InitParameters init_parameters;
2init_parameters.coordinate_units = UNIT::METERS;
3init_parameters.depth_minimum_distance = 0.15 ; // Set the minimum depth perception distance to 15cm

Maximum Range

You can increase the maximum detectable depth by setting depth_maximum_distance in InitParameters. Raising this value allows the camera to estimate depth for objects farther from the lens, up to the hardware’s supported maximum range.

This is useful for applications that require depth information at longer distances.

Depth accuracy decreases with distance, so it’s important to consider the trade-off between range and accuracy. Read more about depth accuracy to understand how it affects your application.

1InitParameters init_parameters;
2init_parameters.depth_mode = DEPTH_MODE::NEURAL ; // Set the depth mode to NEURAL
3init_parameters.coordinate_units = UNIT::METER;
4init_parameters.depth_maximum_distance = 40; // Set the maximum depth perception distance to 40m

Tips:

  • The maximum depth range can be reduced to clamp values above a certain distance. This is useful to reduce depth jitter at long distances.
  • Increasing the maximum range has no impact on memory or FPS.

Depth Stabilization

Depth stabilization is a feature that reduces depth map jitter and enhances accuracy by temporally filtering depth data across multiple frames. It leverages the ZED SDK’s positional tracking to maintain stable depth estimates even when the camera is in motion. The system intelligently distinguishes between static and dynamic regions, ensuring that moving objects are not incorrectly fused, which preserves the integrity of depth information in dynamic scenes.

Depth stabilization is enabled by default. Since it enables positional tracking in the background, you can disable depth stabilization using init_parameters.depth_stabilization = false to improve computational performance.

Tips:

  • For fixed cameras, we recommend enabling PositionalTrackingParameters::set_as_static while using depth stabilization. This allows the depth stabilizer module to know the camera is static so it can disable visual tracking and reduce the computational load.
  • For applications requiring the Positional Tracking module to be disabled, the depth stabilization parameter must be set to 0; otherwise, the Positional Tracking module is automatically activated in the background.
  • Enabling depth stabilization uses temporal tracking to smooth depth over time. However, if the stabilization strength is set too high and objects or the camera move quickly, the system may fail to keep up—causing “ghosting” or motion trails around fast-moving objects. By default, the Depth Stabilization parameter is set to 30.

sl::RuntimeParameters Depth Parameters

For more information on these parameters, see the API documentation page.

Depth Confidence Filtering

Depth estimation can introduce some uncertainty, resulting in points with varying reliability. While a small number of inaccurate points may not impact most applications, scenarios requiring high precision benefit from filtering out less reliable depth data.

To help with this, the ZED SDK provides a confidence map. Each pixel in the confidence map is assigned a value from 0 (high confidence) to 100 (low confidence). Pixels with higher values are less trustworthy and can be excluded or handled differently to improve the overall quality of your depth data.

1sl::Mat confidence_map;
2zed.retrieveMeasure(confidence_map, sl::MEASURE::CONFIDENCE);

To filter out unreliable points from the depth map or point cloud, you can either implement your own filtering function using the retrieved confidence data, or simply set the sl::RuntimeParameters::confidence_threshold parameter. When you set this threshold, the ZED SDK automatically removes all points with a confidence value higher than the specified limit, streamlining the process and ensuring only reliable depth data is used.

Two different types of confidence thresholds are available:

  • confidence_threshold: Filters out depth points with low confidence, primarily removing unreliable measurements around object edges. This helps prevent objects that are close together from appearing “linked” in the depth map.
  • texture_confidence_threshold: Filters out depth points in regions with low image texture (uniform or featureless areas), where depth estimation is less reliable due to insufficient visual information.
ImageOriginal Depth
RGB image of officeDepth map of office
confidence_threshold set to 50texture_confidence_threshold set to 50
Depth with confidence thresholdDepth with texture confidence threshold