Ask Your Question

findChessboardCorners returing false boolean value?

asked 2016-07-26 21:51:58 -0500

kevgeo gravatar image

updated 2016-07-26 21:52:41 -0500

I am using findChessboardCorners function to find the corners in a chessboard image. image description

When I am executing the function on this image, I am getting an array of detected corners but the bool value returned by the function is zero. Shouldn't it be one since I'm getting an array of detected corners?


Mat inImage;
inImage = imread("left01.jpg");
//-> Output
vector<Point2f> corners; // This will be filled by the detected corners

bool found = findChessboardCorners( inImage, Size(8,6), corners, CV_CALIB_CB_ADAPTIVE_THRESH );

cout<<"number of corners detected:"<<corners.size()<<endl;
edit retag flag offensive close merge delete



You get false because you use wrong pattern size 8x6 instead 9x6.

dandur gravatar imagedandur ( 2016-07-27 00:39:27 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2016-07-27 00:35:22 -0500

berak gravatar image

it will only return true, if it found ALL expected corners of the chessboard.

your example has an error there, it should be Size(9,6), not Size(8,6). (you have to count the "inner" corners of the board)

// Size(8,6):
number of corners detected:47

// Size(9,6):
number of corners detected:54
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-07-26 21:51:58 -0500

Seen: 2,211 times

Last updated: Jul 27 '16