Advanced Settings

Sensing Modes

The ZED SDK provides two modes for depth sensing: STANDARD and FILL.

Standard Mode

The STANDARD mode is the default depth sensing mode with the ZED. The STANDARD mode preserves distance metrics and shapes, and runs faster than the FILL mode, but it contains holes due to visual occlusions and filtering. These holes are represented by black areas in the depth image. Use the STANDARD mode for applications such as autonomous navigation, obstacle detection, 3D mapping, people detection and tracking.

To configure depth sensing in STANDARD mode, set SENSING_MODE_STANDARD in RuntimeParameters.

// Grab depth in STANDARD mode
RuntimeParameters runtime_parameters;
runtime_parameters.sensing_mode = SENSING_MODE_STANDARD.
if (zed.grab(runtime_parameters) == SUCCESS) {
}
# Grab depth in STANDARD mode
runtime_parameters =sl.RuntimeParameters()
runtime_parameters.sensing_mode = sl.SENSING_MODE.SENSING_MODE_STANDARD
if zed.grab(runtime_parameters) == sl.ERROR_CODE.SUCCESS :

In STANDARD mode, holes (black pixels) have different values depending on their type. They are associated with an enum:

  • NAN referred as OCCLUSION_VALUE. The depth of the pixel cannot be estimated as it is occluded or an outlier.
  • -INFINITY referred as TOO_CLOSE. The depth of the pixel cannot be estimated as it is too close to the camera.
  • INFINITY referred as TOO_FAR. The depth of the pixel cannot be estimated as it is too far from the camera.

You can check for valid depth values using isValidMeasure().

Fill Mode

The FILL mode provides a fully dense depth map with a Z value for every pixel (X, Y) in the left image. The FILL mode fills holes and occlusions in the depth map and adds a filtering stage that improves edges and temporal stability but can alter the actual distance of objects in the scene.

This mode is recommended for applications such as mixed reality capture and visual effects. The FILL mode requires more resources and will run at a lower FPS than the STANDARD mode.

To configure depth sensing in FILL mode, set SENSING_MODE_FILL in RuntimeParameters.

Confidence Map

You can retrieve a confidence map that represents the confidence of a given distance measure (Z) for every pixel (X, Y) in the image. Confidence values vary between 0 and 100, 0 representing the lowest confidence value possible.

sl::Mat confidence_map;
zed.retrieveMeasure(confidence_map,MEASURE_CONFIDENCE);
confidence_map = sl.Mat()
zed.retrieve_measure(confidence_map, sl.MEASURE.MEASURE_CONFIDENCE)

Depth Modes

Several depth modes are available to improve performance in certain applications: ULTRA, QUALITY, MEDIUM and PERFORMANCE. These settings adjust the level of accuracy, range and computational performance of the depth sensing module.

  • The Ultra mode offers the highest depth range and better preserves Z-accuracy along the sensing range.
  • The Quality and Medium modes offer a compromise between quality and speed.
  • The Performance mode disables some filtering operations and oeprates at a lower resolution to improve performance and frame rate.

Generally speaking, we recommend using the ULTRA mode for both desktop and embedded applications. If your application requires a lot of resources, switch to PERFORMANCE mode.

Depth Range

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

Depth Range ZED ZED Mini
Default 0.7m to 20m (2.3 to 65ft) 0.3m to 20m (1 to 65ft)
Min range 0.3m (1ft) 0.15m (0.5ft)
Max range 40m (131ft) 20m (65ft)

Minimum Range

The minimum range can be lowered from its default value using the depth_minimum_distance setting in InitParameters.

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.UNIT_METER
init_parameters.depth_minimum_distance = 0.15 # Set the minimum depth perception distance to 15cm

Maximum Range

The maximum range can be increased using setDepthMaxRange(). We recommend using the ULTRA depth mode to improve depth accuracy at long distances.

InitParameters init_parameters;
init_parameters.depth_mode = DEPTH_MODE_ULTRA ; // Set the depth mode to ULTRA
init_parameters.coordinate_units = UNIT_METER;
zed.setDepthMaxRangeValue(40); // Set the maximum depth perception distance to 40m
init_params = sl.InitParameters()
init_parameters.depth_mode = sl.DEPTH_MODE.DEPTH_MODE_ULTRA # Set the depth mode to ULTRA
init_parameters.coordinate_units = UNIT_METER;
zed.setDepthMaxRangeValue(40); # Set the maximum depth perception distance to 40m

Tips:

  • The maximum depth range can be reduced to clamp values above a certain distance using setDepthMaxRange(). This is useful to reduce depth jitter at long distances.
  • Performance can be improved by increasing the minimum depth perception distance. For applications requiring long-range depth perception, we recommend setting depth_minimum_distance to 1m or more.

Depth Accuracy

Stereo vision uses triangulation to estimate depth from a disparity image, with the following formula describing how depth resolution changes over the range of a stereo camera:

Dr=Z^2*alpha, where Z is the distance and alpha a constant.

Depth accuracy decreases quadratically over the z-distance, with a stereo depth accuracy of 1% of the distance in the near range to 9% in the far range. Depth accuracy can also be affected by outliers’ measurements on homogenous and textureless surfaces such as white walls, green screens and specular areas. These surfaces usually generate temporal instability in depth measurements.

Best Practices

The ZED can be used both indoors and outdoors at long range (up to 20m). The configuration that offers the best depth accuracy is to place the camera at a working distance of 1 meter of the scene. To capture fast movements, use the camera high-speed modes (HD720 @ 60 FPS or VGA @ 100 FPS). Avoid using the camera in very low-light environments as the camera does not use IR but color images for depth perception.

You can also extend the range of the USB cable up to 15m by using an USB 3.0 extension cable and up to 100m using an optical fiber USB 3.0 extender.