Ask Your Question
4

Why does camera calibration work on one image but not on a (very similar) other image?

asked 2012-08-09 08:24:34 -0600

alexe gravatar image

updated 2012-08-20 12:41:08 -0600

Hello, I am having to very similiar images of a chessboard pattern. Each is taken by a different camera with a slightly different distortion. However, with the calibration sample code provided in the OpenCV (OpenCV Version 2.4.2) package (OpenCV-2.4.2/samples/cpp/calibration.cpp) I can calculate the camera parameters from of one image (hence for one camera), but not for the other image.

If I run the code in the Debugger the variable found in line 468 is having the value false, indicating that no chessboard corners where detected (with the picture that doesnt work).

I use the programm from the commandline using the following parameters: calibration -w 13 -h 9 -s 18 -o camera.yml -op -oe imagelist.yaml

Calibration WORKS Calibration DOES NOT WORK

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
5

answered 2012-08-09 15:15:27 -0600

updated 2012-08-10 02:19:47 -0600

Hello,

The second image is more challenging because the chessboard is closer to a border of the image and there is too little space around the board. Moreover, the board is shadowed which makes chessboard detection even more difficult.

Documentation of cv::findChessboardCorners contains a useful note regarding this situation:

The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails.

P.S. Usually 10-40 different images of a chessboard are captured to calibrate a camera accurately. Calibration with fewer number of images is too uncertain.

edit flag offensive delete link more

Comments

Thank you very much for your information!

alexe gravatar imagealexe ( 2012-08-10 00:40:14 -0600 )edit
2

Also, here is a guide of how to take good images for calibration: http://graphics.cs.msu.ru/ru/science/research/calibration/recommendations

gfuhr gravatar imagegfuhr ( 2012-08-10 11:35:01 -0600 )edit

Question Tools

Stats

Asked: 2012-08-09 08:24:34 -0600

Seen: 2,103 times

Last updated: Aug 10 '12