What are the internal workings of the OpenCV function findChessboardCorners?
The source code of OpenCV is available, so I'd recommend just taking some time going through the code. The relevant file for this particular function is:
I've not looked into it in detail, but it looks like
int cvFindChessboardCorners( const void* arr, CvSize pattern_size,
CvPoint2D32f* out_corners, int* out_corner_count,
int flags )
is the main implementation of this method. In here they
cvCheckChessboardto determine if a chessboard is in the image
- Convert to binary (B&W) and dilate to split the corners apart
icvGenerateQuadsto find the squares.
The code then seems to go though a set of checks to condense these
quads to chessboard corners, including
icvCleanFoundConnectedQuads to remove extra corners,
All of these functions are implemented in the same file, apart from
cvCheckChessboard which is in calib3d/src/checkchessboard.cpp. Depending how well you wanted to understand the code, there seem to be a number of debugging lines, which can be included if you
#define DEBUG_CHESSBOARD, that may help you see what's going on.