can anyone provide a good sample program on OpenCV depth maps or distance calculation?
In OpenCV's samples/cpp folder there is a sample program called stereo_match.cpp.
samples/cpp
stereo_match.cpp