I am currently trying to understand how OpenCV's SGBM disparity algorithm works, I know the pixel cost calculations follows Birchfield and Tomasi algorithm. http://robotics.stanford.edu/~birch/publications/dissimilarity_pami1998.pdf
I cannot seem to figure out what is clipTab[TAB_SIZE] and why is it filled this way.
int ftzero = std::max(params.preFilterCap, 15) | 1;
PixType clipTab[TAB_SIZE];
for( k = 0; k < TAB_SIZE; k++ )
clipTab[k] = (PixType)(std::min(std::max(k - TAB_OFS, -ftzero), ftzero) + ftzero);
The full code can be found using this link:
https://github.com/opencv/opencv/blob/master/modules/calib3d/src/stereosgbm.cpp