Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It seems that camera is calibrated quite well, reprojection error 0,26 pixel is good.

The reason maybe that disparitystrong text computed by SGBM is for some reason multiplied by 16.

See this excerpt from OpenCV documentation:

disp – Output disparity map. It is a 16-bit signed single-channel image of the same size as the input image. It contains disparity values scaled by 16. So, to get the floating-point disparity map, you need to divide each disp element by 16.

Distance to the camera (Z coordinate) is inversly proportional to disparity. So you can equivalently multiply Z-coodinate by 16. Taking into account this scaling coefficient you have: 6*16 = 96 which is pretty close to 100.

It seems that camera is calibrated quite well, reprojection error 0,26 pixel is good.

The reason maybe of your issue could be that disparitystrong text computed by SGBM is for some reason multiplied by 16.

See this excerpt from OpenCV documentation:

disp – Output disparity map. It is a 16-bit signed single-channel image of the same size as the input image. It contains disparity values scaled by 16. So, to get the floating-point disparity map, you need to divide each disp element by 16.

Distance to the camera (Z coordinate) is inversly proportional to disparity. So you can equivalently multiply Z-coodinate by 16. Taking into account this scaling coefficient you have: 6*16 = 96 which is pretty close to 100.

The reason of your issue could be that disparitystrong text disparity computed by SGBM is for some reason multiplied by 16.

See this excerpt from OpenCV documentation:

disp – Output disparity map. It is a 16-bit signed single-channel image of the same size as the input image. It contains disparity values scaled by 16. So, to get the floating-point disparity map, you need to divide each disp element by 16.

Distance to the camera (Z coordinate) is inversly proportional to disparity. So you can equivalently multiply Z-coodinate by 16. Taking into account this scaling coefficient you have: 6*16 = 96 which is pretty close to 100.