Depth Settings
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.
ZED Mini | |
---|---|
Focal Length | 3mm |
Max Depth Range | 0.1m to 15m (0.3ft to 49ft) |
Ideal Depth Range | 0.1m to 9m (0.3ft to 13.1ft) |
ZED 2i - Wide | ZED 2i - Narrow | |
---|---|---|
Focal Length | 2.1mm | 4mm |
Max Depth Range | 0.3m to 20m (1.0ft to 65.6ft) | 1.5m to 35m (4.9ft to 114.8ft) |
Ideal Depth Range | 0.3m to 12m (1.0ft to 39.4ft) | 1.5 to 20m (4.9ft to 65.6ft) |
ZED X - Wide | ZED X - Narrow | |
---|---|---|
Focal Length | 2.2mm | 4mm |
Max Depth Range | 0.3m to 20m (0.98ft to 65.6ft) | 1.0m to 35m (3.3ft to 114.8ft) |
Ideal Depth Range | 0.3m to 12m(0.98ft to 39.4ft) | 1.0m to 20m (3.3ft to 65.6ft) |
ZED X Mini - Wide | ZED X Mini - Narrow | |
---|---|---|
Focal Length | 2.2mm | 4mm |
Max Depth Range | 0.1m to 8m (0.3ft to 26.2ft) | 0.15m to 12m (0.5ft to 39.4ft) |
Ideal Depth Range | 0.1m to 4m (0.3ft to 13.1ft) | 0.15m to 6m (0.5ft to 19.7ft) |
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.
InitParameters init_parameters;
init_parameters.coordinate_units = UNIT::METERS;
init_parameters.depth_minimum_distance = 0.15 ; // Set the minimum depth perception distance to 15cm
init_params = sl.InitParameters()
init_parameters.coordinate_units = sl.UNIT.METER
init_parameters.depth_minimum_distance = 0.15 # Set the minimum depth perception distance to 15cm
InitParameters init_parameters = new InitParameters();
init_parameters.coordinateUnits = UNIT.METER;
init_parameters.depthMinimumDistance = 0.15f ; // 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.
InitParameters init_parameters;
init_parameters.depth_mode = DEPTH_MODE::NEURAL ; // Set the depth mode to NEURAL
init_parameters.coordinate_units = UNIT::METER;
init_parameters.depth_maximum_distance = 40; // Set the maximum depth perception distance to 40m
init_params = sl.InitParameters()
init_parameters.depth_mode = sl.DEPTH_MODE.NEURAL # Set the depth mode to NEURAL
init_parameters.coordinate_units = UNIT.METER
init_parameters.depth_maximum_distance = 40 # Set the maximum depth perception distance to 40m
InitParameters init_parameters = new InitParameters();
init_parameters.depthMode = DEPTH_MODE.NEURAL ; // Set the depth mode to NEURAL
init_parameters.coordinateUnits = UNIT.METER;
init_parameters.depthMaximumDistance = 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.
sl::Mat confidence_map;
zed.retrieveMeasure(confidence_map, sl::MEASURE::CONFIDENCE);
confidence_map = sl.Mat()
zed.retrieve_measure(confidence_map, sl.MEASURE.CONFIDENCE)
Mat confidence_map = new Mat();
zed.RetrieveMeasure(confidence_map, 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.
Image | Original Depth |
---|---|
![]() | ![]() |
confidence_threshold set to 50 | texture_confidence_threshold set to 50 |
![]() | ![]() |