Ask Your Question

Incorrect stereo camera calibration

asked 2014-06-21 05:36:54 -0500

aardvark gravatar image

updated 2014-06-30 08:29:31 -0500


I'm trying to calibrate a stereo camera setup using OpenCV's standard calibrateCamera() and stereoCalibrate() functions. The cameras are mounted in a smartphone, approximately 35 mm apart from each other and they face the same direction.

The problem is that the stereo reconstruction using the results of the calibration gives huge distortions of the reconstructed scene. I think that this may be caused by wrong extrinsic parameters (relative rotation and translation of the cameras). Especially the translation look suspicious to me. As far as I understand, the length of the translation vector should be comparable to the distance between the cameras. However, the length of the T vector resulting from my calibration varies between 16.7 and 23.4 mm, depending on which of the following approaches I use:

1) Checkerboard calibration pattern, square size 19x19 mm, 12x10 corners:

a) Independent intrinsic calibration of the cameras with calibrateCamera(), then stereo calibration with stereoCalibrate() using the cameras' matrices and distortions found in the intrinsic calibration as ultimate (CV_CALIB_FIX_INTRINSIC)

b) Independent intrinsic calibration of the cameras with calibrateCamera(), then stereo calibration with stereoCalibrate() using the cameras' matrices and distortions from intrinsic calibration as the initial values for optimization (CV_CALIB_USE_INTRINSIC_GUESS)

2) Asymmetric circle grid, 9x3 circles, grid size 30.2 x 30.2 mm - the same two options a and b, as in point 1.

3) One-step calibration using stereoCalibrate() only.

Have you got any experience with this problem? The detailed results of the calibration are attached in the PDF here. I also attach the original images I use, should someone want to check the calibration themselves.

Update 2014-06-30:

Matthieu, thank you for your response.

Yes, I am pretty sure, that the corners on the checkerboard are correctly detected, because I do the detection semi-manually, using Bouguet's Camera Calibration Toolbox for Matlab (afterwards I import the extracted corner positions to my OpenCV calibration program). The corners are detected with sub-pixel accuracy.

I repeated the whole calibration with a new checkerboard pattern, using 85 images of it. I also did the best I can to get rid of the blur. The results are not much better. The relative camera translation vector, which is a sanity check parameter for me, is now [-23.41713024477083; 0.05333133785688135; -7.846262984094929]. And the reconstruction is still distorted. As previously, I enclose the detailed results and the images.

Is the distortion model of the calibration procedure incompatible with my camera setup? Or is it maybe the small base length, that makes the optimization algorithm get stuck on some local minimum? What do you think?

PS. By the way, the results with the Camera Calibration Toolbox for Matlab are no better.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-06-21 06:40:47 -0500

If you experience issues with distortion, it's probably related to the intrinsic parameters, not extrinsic parameters. And, if intrinsic parameters aren't accurate, then extrinsic could be completely wrong!

Your chessboard is suspicious to me, the border shouldn't be made by half square. Are you sure corners are correctly detected?

Using 14 images isn't enough for intrinsic calibration, I usually used at least 50. I haven't tested the stereo calibration with few images, but I suggest you try it with 50 also.

Try to avoid the blur on the pattern, the accuracy will be better, and the detection faster (as the algorithm doesn't need too many steps to separate corners). Did you compute a sub-pixel accuracy after the pattern detection?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2014-06-21 05:36:54 -0500

Seen: 2,003 times

Last updated: Jun 30 '14