Ask Your Question

cpp-example-calibration fails; displays images but does not export camera.yml

asked 2014-03-03 13:32:36 -0500

meh gravatar image

updated 2014-03-03 13:42:37 -0500

berak gravatar image

I'm running cpp-example-calibration under Linux with a set of 6 chessboard images in an attempt to get camera distortion information. My command looks like this:

../cpp-example-calibration -w 7 -h 5 -pt chessboard -o camera.yml -op -oe imagelist.xml

and my imagelist.xml looks like this:

<?xml version="1.0"?>
pic1.jpg pic2.jpg pic3.jpg pic4.jpg pic5.jpg pic6.jpg </images>

a sample image from my calibration set is: image description

I've run this on two different Linux machines so far with the same result: Image View pops up, displays the 6 images unmodified in sequence, and then closes. This process takes 5 or so minutes, so it is doing some work, but it doesn't produce a .yml file! Does anyone have any ideas about what I'm doing wrong?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-03-04 02:08:31 -0500

jensenb gravatar image

You are using the wrong number of corners in your command. The OpenCV docs clearly specify that you have to supply the number of inner corners for the width and height parameters. So in your case this would be

../cpp-example-calibration -w 6 -h 4 -pt chessboard -o camera.yml -op -oe imagelist.xml

In general when the board detection fails the primary error source is usually incorrect parameters.

edit flag offensive delete link more


How does the algorithm know the size of the squares?

ErickM gravatar imageErickM ( 2015-01-31 17:06:38 -0500 )edit

Came here, had the same problem. Frankly, to find the documentation is a PITA, and "inner corners" is not exactly a measurement that is intuitive to understand. A properly written program should print the error and not just do nothing. Clearly the example should be amended to provide better user feedback.

0__ gravatar image0__ ( 2016-11-11 08:43:10 -0500 )edit

Question Tools

1 follower


Asked: 2014-03-03 13:32:36 -0500

Seen: 500 times

Last updated: Mar 04 '14