Template Function lib3d::computeDepthError
Defined in File evaluation.hpp
Function Documentation
-
template<typename T>
void lib3d::computeDepthError(const cv::Mat &iEstimatedDepthmap, const cv::Mat &iGroundtruthDepthmap, T &oL1Abs, T &oL1Rel, T &oDensityEstimate, T &oDensityGroundtruth, std::vector<T> &oAccuracy, std::vector<T> &oCompleteness, std::vector<T> &oFScore, cv::Mat &oAbsDiffMap, const bool iAdjustScaling = true, const std::vector<T> &iAccComplThresh = {0.25, 0.2, 0.15, 0.1, 0.05, 0.01}, const cv::Mat &iRoiMask = cv::Mat()) Method to compute error of a depth map with respect to a given ground truth.
Only pixels for which a predicted estimate and a ground truth is given, are evaluated.
Note
Input depthmaps have to be of same size and type.
- Parameters:
iGroundtruthDepthmap – [in] Ground truth depth map given as .
oL1Abs – [out] Average absolute difference between the estimated depth map and its ground truth. This can also be considered as the absolute \(\text{L1}\) error:
\[\text{L1-abs} = \frac{1}{m}\sum_{m}\left|d-\hat{d}\right|\]With \(d\) and \(\hat{d}\) being the predicted depth and the ground truth depth value, and \(m\) being the pixels for which both \(d\) and \(\hat{d}\) exist.oL1Rel – [out] Relative \(\text{L1}\) error:
\[\text{L1-rel} = \frac{1}{m}\sum_{m}\frac{\left|d-\hat{d}\right|}{\hat{d}}\]With \(d\) and \(\hat{d}\) being the predicted depth and the ground truth depth value, and \(m\) being the pixels for which both \(d\) and \(\hat{d}\) exist.oDensityEstimate – [out] Density of predicted depth map.
oDensityGroundtruth – [out] Density of ground truth depth map.
oAccuracy – [out] Fraction of estimated depth values, which are within a distance threshold of the ground truth. List of thresholds is to be which are to be used for calculation are given in iAccComplThresh.
oCompleteness – [out] Amount of ground truth pixel for which their distance to the corresponding estimate is below the evaluation threshold. List of thresholds is to be which are to be used for calculation are given in iAccComplThresh.
oFScore – [out] Harmonic mean between oAccuracy and oCompleteness.
[out} – oAbsDiffMap Difference map holding per pixel absolute different between estimate and groundtruth.
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.
iAccComplThresh – [in] List of thresholds which are to be used for calculation of accuracy and completeness.
iRoiMask – [in] Binary mask indicating region of interest. If provided the error is only calculated for the pixels for wich iRoiMask = 1.
T – Type of depth maps.