Closed Diksha-Moolchandani closed 3 years ago
I'm sorry I didn't write this part of the code, considering that this will introduce other third-party libraries.
Thanks a lot for the reply.
However, this is specific to Middlebury. I want to evaluate it for KITTI 2015 training dataset: http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=stereo For evaluating for KITTI, I used the disparity array and calculated the 3-pixel error with respect to the ground truth image that is in png format that is read using cv::imread. Also, there is no factor for the KITTI dataset.
The error comes out to be 67.6% for adcensus algorithm with min disparity 0 and max disparity 64. Can you help me with this dataset?
Strange. Did you skip those invalid disparities which are equal to Invalid_Float? or did you only evaluate those pixels who have truth-value?
Yes. I used only valid values and those pixels that have positive value in the ground truth.
I used this code snippet:
double sum = 0; int count = 0; float ans = 0; cv::Mat myMap = cv::imread(gt_path);
for (sint32 i = 0; i < height; i ++)
{
for (sint32 j = 0; j < width; j ++)
{
if(myMap.at<uchar>(i,j) > 0 && abs(disparity[i * width + j]) != Invalid_Float ){
sum++;
ans = abs(disparity[i * width + j] - myMap.at<uchar>(i,j));
if ( (ans > 3.0) && (ans / myMap.at<uchar>(i,j) > 0.05))
count ++;
}
}
}
double result = (count + 0.0)/sum;
cout << "disp path is: " << gt_path << endl;
cout << "error is: " << result * 100 << endl;
Try to use cv::imread(gt_path,0)? cv::imread load image in 3 channels by default.
Thanks a lot. That reduced the error to 18% for adcensus (min disparity 0 and max disparity 64).
OK. Try to set “ad_option.do_filling = false” and then computing error again.
It reduced further to 10.99%
OK. That's all I can think of for now.
thanks a lot.
With the above two changes, I am getting an error of 2.5% for semiglobal matching. The filling line was already false in semiglobal code. sgm_option.is_fill_holes = false;
Sounds good
For PatchMatch, it is 14-15%. Can the error for PatchMatch and AD-Census be reduced further? Or are they inherently inferior to semi-global matching?
What is the error for this code?
When I used the Middlebury evaluation SDK, I got a very high error of 85% if I set the bad threshold to 10. The AD-Census algorithm is run with the default disparity values. The final image generated is compared with the ground truth image present in the repo.
Upon increasing the threshold, the error decreases. However, this does not seem to be right. Because increasing the threshold means we are allowing a larger margin for error in the pixel values of the generated disparity and the ground truth disparity.
Is there some bug in the code or the method of evaluation needs to be changed? Can anyone help in this regard?