Ask Your Question
0

3D scale is poor.

asked Sep 14 '12

kazu gravatar image

I got 3D point cloud by using stereo camera and sample stereo_calib.cpp and stereo_match.cpp. And, when viewed in the point cloud gnuplot, scale is very small compared with the reality.

I used 9x6 checkerboard of square size 3.45cm. Of course, squareSize of source code, I've assigned a 3.45. As a result, RMS error=0.221828 and reprojection error=0.261209, and rectified images was good. Then, place the object to the location of the shooting distance of 100cm from the stereo camera, I got a 3D point cloud using stereo SGBM. However, average Z value of that object was 6.

Why not?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
4

answered Sep 15 '12

Jacek gravatar image

updated Sep 15 '12

The reason of your issue could be that 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.

Preview: (hide)

Question Tools

Stats

Asked: Sep 14 '12

Seen: 675 times

Last updated: Sep 16 '12