First time here? Check out the FAQ!

Ask Your Question
4

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

asked Aug 9 '12

alexe gravatar image

updated Aug 20 '12

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

Preview: (hide)

1 answer

Sort by » oldest newest most voted
5

answered Aug 9 '12

updated Aug 10 '12

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.

Preview: (hide)

Comments

Thank you very much for your information!

alexe gravatar imagealexe (Aug 10 '12)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 (Aug 10 '12)edit

Question Tools

Stats

Asked: Aug 9 '12

Seen: 2,153 times

Last updated: Aug 10 '12