Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Z = B*f / disparity is the correct formula to get the depth in mm.

(B is the baseline, the distance between the cams, and f the focal length)

but to apply proper block matching, you have to calibrate your stereo rig (and undistort the images)

the resulting Camera matrix holds the value(s) for f.

(there's a sample here, but in c++)