Interactive calibration frame rejected

asked 2017-01-05 15:34:52 -0600

Fnoop gravatar image

updated 2017-01-10 10:18:38 -0600

So I'm trying to use opencv_interactive-calibration with the following parameters: opencv_interactive-calibration -ci=4 -h=5 -w=8 --pf=defaultConfig.xml --of=cameraParameters.xml -t=charuco

My config looks like this:

<?xml version="1.0"?>
<camera_resolution>1280 720</camera_resolution>

I'm using a charuco pattern like this: image description

The pattern is printed and laminated on A3. It was created like this: ./create_charuco -w=8 -h=5 --ml=50 --sl=80 -d=14 ~/charuco-pattern.png so marker length 50 and square length 80. Obviously if this is pixels it's now meaningless as it's been blown up through printing to A3, but I'm guessing (naively, hopefully) that this is a ratio rather than an absolute size in pixels? I have no idea what --sz (value:16.3) parameter means in terms of scale or units, or if it's needed for charuco pattern.

So the trouble I have is that running the interactive calibrator brings up a window (very slow, over ssh/X) that recognises the aruco symbols when presented and draws lots of blue lines off the right hand edge of the screen, and when you get the entire pattern into frame it gives a white flash and says 'Frame rejected' every time, over and over. It gives no further info so I have absolutely no idea where to go from here, I can't see any kind of debug/log output and it's not producing anything into cameraParameters.xml.

The camera_resolution config setting, what is that for exactly? As the calibrator seems to control the camera through v4l2 (I'm specifying video4) I assume it's setting the resolution - my default resolution for my camera is 640x480 but the preview window seems to be much larger, I'm guessing at least 1280x720. Would be nice to do it in 640x480 somehow as that is the resolution it will always capture in real use.

Help please :)

Also, bonus points if anyone can answer if this calibrator will provide necessary calibration for depth (ie range) measurement, or if is it just for distortion?

Edit (after a couple more days of frustration): OK, so it appears that the detector is sensitive to ambient light levels, when I've had some free time during the daytime to try it I'm getting successful captures. I'm still getting wierd blue lines off the right hand side of the screen when trying the calibration on an embedded linux computer (odroid) but it is accepting captures now. Wierd, in that in the lower light levels it was still happily detecting all the patterns. I've also tried using inbuilt camera on macbook and plugging my oCam usb3 camera into the macbook and tried the interactive calibrator. I get successful captures and mostly fill the green ghosty things, but it never ... (more)

edit retag flag offensive close merge delete



I'm guessing the --sz parameter is in mm so I've measured the distance between center of adjacent squares (one aruco, one black) on the pattern which is 65mm and used that. So --sz=65. Still getting frame rejected, it's as soon as I get all the pattern squares into view and it recognises all the aruco IDs, it flashes white and says frame rejected. All this rejection is harshing my buzz :(

Fnoop gravatar imageFnoop ( 2017-01-06 04:19:42 -0600 )edit

Question. When you print it, did it stretch different amounts in the X and Y direction?

Secondly, yes, you should put the actual resolution of the images your camera returns into the camera resolution parameter.

Tetragramm gravatar imageTetragramm ( 2017-01-06 23:00:43 -0600 )edit

Thanks for the response :) The print looks to be the same ratio, the only difference is the white border around the edges isn't as large as they expanded the pattern most of the way to the edge. The problem with the resolution is I don't know what the camera is returning - I assume that the calibrator is capturing using v4l2 and setting the resolution. My camera usually returns 640x480 by default but clearly the calibrator is capturing at a much higher widescreen format.

Fnoop gravatar imageFnoop ( 2017-01-07 02:34:38 -0600 )edit

Bit of success, I'm now getting successful captures in better light conditions. But I can't get a successful calibration, it never ends. I've edited the main question with more details and screenshot.

Fnoop gravatar imageFnoop ( 2017-01-07 05:53:38 -0600 )edit

your grid seems folded

LBerger gravatar imageLBerger ( 2017-01-07 10:59:39 -0600 )edit

The calibration board must be the most possible flat. You should glue it on a rigid flat object. Also, the reflections (due to the glossy film?) are not good for the image processing.

Also, don't forget to use multiple orientation (rotation about the 3 axis) of the pattern, not only translations.

Eduardo gravatar imageEduardo ( 2017-01-07 11:01:07 -0600 )edit

Thanks for the responses, I've edited the main question again with updates.

Fnoop gravatar imageFnoop ( 2017-01-10 10:19:46 -0600 )edit

It seems like only the reprojection error is nok now. I suspect the threshold for the reprojection error being < 0.5. If you are satisfied with the calibration, maybe hitting the s key will save the current parameters (I never used this application)?

Eduardo gravatar imageEduardo ( 2017-01-10 10:59:41 -0600 )edit

Doh, can't believe I missed that option. Thanks, will try saving and see how I get on!

Fnoop gravatar imageFnoop ( 2017-01-10 11:13:43 -0600 )edit