Ask Your Question
0

stereoCalibrate intermittantly fails

asked 2013-03-14 15:36:56 -0600

jim_73_mk1 gravatar image

updated 2013-03-14 18:23:23 -0600

I am running a stereo calibration after calibrating each camera independently. When running the stereo calibrate if I leave the chessboard pattern visible to the two cameras relatively close and not moving it then the stereo calibration works. Moving farther away also works but if the calibration board is moved around it will typically fail with an assertion error:

OpenCV Error: Assertion failed (nimages > 0 && nimages == (int)imagePoints1.l() && (!imgPtMat2 || nimages == (int)imagePoints2.total())) in unknown func, file ......\src\opencv\modules\calib3d\src\calibration.cpp,line 3168

I assume the data passed into stereoCalibrate() is correct since it works when the calibration pattern is not moved. Why would moving the calibration pattern cause the stereo calibration to fail?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-03-15 08:53:56 -0600

berak gravatar image

updated 2013-03-15 09:05:57 -0600

i don't know about your code, but you have to make sure before, that ALL images passed in there actually contain a COMPLETE chessboard ( or whatever pattern you're using ).

you probably have to check for the outcome of findchessboardcorners before adding the images to your list

cut corners, partly obscured stuff, reflections. lot of things can go wrong. yes, that happens, when moving around, but you have to cover the whole visible space, and possible rotations, to get a valid calibration, so 20 shots of the same thing is not an option

edit flag offensive delete link more

Comments

Thank you for responding... Yes I am checking to make sure both captured images have found all the chessboard corners as follows:

if(findChessboardCorners(view_0, board_size, pointBuf_0, CV_CALIB_CB_ADAPTIVE_THRESH CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE)) { found = findChessboardCorners(view_1, board_size, pointBuf_1, CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE); }

In this case the variable "found" can only be true if both cameras see all the corners. Only then will the images be processed and parameters stored for passing along to stereoCalibrate().

Is it possible that findChessboardCorners() sometimes returns true when not all corners are found?

jim_73_mk1 gravatar imagejim_73_mk1 ( 2013-03-15 10:25:02 -0600 )edit

bool, so no. bit out of ideas atm ;(

berak gravatar imageberak ( 2013-03-15 10:30:03 -0600 )edit

Question Tools

Stats

Asked: 2013-03-14 15:36:56 -0600

Seen: 955 times

Last updated: Mar 15 '13