rtabmap icon indicating copy to clipboard operation
rtabmap copied to clipboard

Chess board image generation doesn't match the parameters

Open jlunder opened this issue 3 months ago • 1 comments

When running calibration, the chessboard image generator generates an image that is the wrong size for the entered parameters, preventing calibration. The image should be 1 square larger than the entered numbers in each axis (or the calibration should pass the values through 1 smaller to OpenCV).

E.g., if I have an 8x8 standard chessboard, OpenCV wants this described as a 7x7 calibration target. So if I've entered 8x8 into the dialog, either it should generate a 9x9 image and pass 8x8 into OpenCV, or generate an 8x8 image and pass 7x7 into OpenCV -- otherwise one can spend a lot of time trying to calibrate, wondering if the lighting is wrong, or the angle, or maybe the printing wasn't precise enough, or the target is too wavy...

See https://stackoverflow.com/a/28866120

Also, OpenCV will crash with an assert fail if you pass values smaller than 2x2 into the calibration, so it's probably a good idea to filter the inputs before passing them in.

jlunder avatar Aug 31 '25 05:08 jlunder

Thanks for reporting. It has been fixed in the commit above. The expected size in the config is the OpenCV one (number of internal corners). Here is an example of a 7x7 chessboard:

Image

or a 8x6:

Image

matlabbe avatar Sep 03 '25 23:09 matlabbe