Depth Confidence Filtering

Since depth data is estimated, some depth points may not be accurate. In many situations having some inaccurate points in the whole set is not a big deal but in some cases it is.

To overcome this, a confidence map is given. It gives every pixel (X, Y) in the image a value in the range [0,100], pixels having a value close to 100 are not to be trusted.

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 remove the corresponding points from the depth or point cloud you can do you own function using the retrieved data, or you can directly defined it in sl::RuntimeParameters::confidence_threshold, this way the ZED SDK does the job, and removes from the data all points having confidence higher than the defined threshold.

Two confidence thresholds are available:

  • confidence_threshold: removes points on edges to avoid ’linked’ objects.

  • texture_confidence_threshold: removes points from images’ uniform areas.

ImageOriginal Depth
confidence_threshold set to 50texture_confidence_threshold set to 50