Ask Your Question
0

findChessboardCorners returing false boolean value?

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

kevgeo gravatar image

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

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?

Code-

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<<"found::"<<found<<endl;
cout<<"number of corners detected:"<<corners.size()<<endl;
edit retag flag offensive close merge delete

Comments

1

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

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

1 answer

Sort by ยป oldest newest most voted
0

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

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):
found::0
number of corners detected:47

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

Question Tools

1 follower

Stats

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

Seen: 3,755 times

Last updated: Jul 27 '16