Template Function lib3d::computeConfidenceAccROC

Function Documentation

template<typename T>
void lib3d::computeConfidenceAccROC(const cv::Mat &iConfidenceMap, const cv::Mat &iEstimatedMap, const cv::Mat &iGroundtruthMap, std::vector<std::pair<T, T>> &oRocValues, T &oAUC, T &oOptimalAUC, const float iAccThresh = .05f, const bool iAdjustScaling = true, const cv::Mat &iRoiMask = cv::Mat())

Method to compute values for ROC curve in which L1-abs depth error ist evaluated with respect to an additional confidence map.

In this context, a ROC curve represents the error rate as a function of the percentage of pixels sampled from a disparity map in the order of increasing uncertainty. More precisely, in the first step, the 5% of pixels having the lowest uncertainty, i.e. the highest confidence are sampled from an estimated map and the percentage of erroneous pixels in this set is determined. In the second step, this procedure is repeated, but using the 10% of pixels with the lowest uncertainty. This procedure is further applied in 5% steps, until the full density is reached, so that the error of the last set is equal to the overall error of the estimated disparity map.

In addition, Area Under the Curve (AUC) is computed for the previously estimated ROC curve, which can then used to assess the accuracy of a uncertainty map regarding the detection of wrong assignments.

See also

Mehltretter, M. & Heipke, C. Aleatoric uncertainty estimation for dense stereo matching via CNN-based cost volume analysis ISPRS Journal of Photogrammetry and Remote Sensing, Elsevier BV, 2021

Note

Input maps have to be of same size and type.

Note

Since lib3d::types::NormalMap is a subclass of they can be passed directly to this function.

Parameters:
  • iConfidenceMap[in] Confidence map.

  • iEstimatedMap[in] Estimated range map. Can be a depth or disparity map, or any other which can be evaluated with a absolute L1 measure with respect to the ground truth.

  • iGroundtruthMap[in] Ground thruth range map of same type as iEstimatedMap

  • oRocValues[out] Vector of paired values for the ROC curve. The first value of each pair holds the density threshold, while the second value holds the corresponding error value.

  • oAUC[out] Area under the curve.

  • oOptimalAUC[out] Assuming that an optimal uncertainty map contains smaller values for every correct disparity assignment than for any incorrect one, all pixels with a correct disparity assigned are sampled before any pixel with an incorrect one. Under this assumption, the optimal AUC can be computed directly from the overall error

  • iAccThresh[in] Accuracy threshold. Default is 0.25, meaning that for each pixel the estimate and the ground truth is only allowed to differ up to 25% in their value.

  • iAdjustScaling[in] Flag to adjust scaling of estimated depth map in order account for scale ambiguities by minimizing pixel-wise quadratic difference between ground truth and estimate.

  • iRoiMask[in] Binary mask indicating region of interest. If provided the error is only calculated for the pixels for wich iRoiMask = 1.