I've recently been working on the KITTI dataset- specifically the stereo subsection. I tried to replicate the results using the OpenCV SGBM method. I have used all the same parameters as specified on the OpenCV results page in the KITTI website.
Visually the disparity map looks fine and is fairly similar to the result posted on the KITTI-OpenCV evaluation page. But when I try to calculate the error on the training dataset using the ground truth, the error is always at 100%.
The maximum pixel values from the OpenCV SGBM- stereo compute function are coming out to be ~1000 ish with a couple of images(around 5 image pairs) having higher values. I believe that the output returned by the function is of int16 type. I'm computing the error using the evaluation functions given in the devkit and when I read the ground truth(GT) and print out the max values they range upto ~32k . The evaluation function divides the GT and the estimated disparity image by 256 and then computes the absolute difference. If difference is grater than 3 and if the individual error is greater than 5% of the GT value then the pixel is counted as a bad/error pixel and the total error is given as a percentage of such bad pixls to the total pixels. Since the ranges are so different, If I use the above mentioned procedure usually all pixels end up being above the error threshold. So, Do I need to do any scaling of the output from OpenCV SGBM or is there anything that I'm missing while generating disparity/calculating error?