I can use FindChessboardCorners functions for images that less than 15 Mega pixel such like 2k x 1.5k. however when I use it on the image from DSLR, the resolution at 3700x5300, it doesn't work.
I tried to use resize() to reduce the image size directly, then it works.
Obviously there's some hard coded or bug in the OpenCV source code.
Could you help me to figure it out, or point me to a patch for this ?
I found someone posted a similar issue in 2006, here, so it looks like the problem still remains.
The code I used is like
found = findChessboardCorners( viewGray, boardSize, ptvec,
CV_CALIB_CB_ADAPTIVE_THRESH + CV_CALIB_CB_FILTER_QUADS + CV_CALIB_CB_NORMALIZE_IMAGE + CV_CALIB_CB_FAST_CHECK);
Update
Just here to clarify. I think the algorithm works on large image resolution, but it fails when the chessboard occupy larger proportion of the image. For example, when I use a 50mm fixed lens on the same camera position, FindChessboardCorners never fails. After I change it to 100mm fixed lens, the function starts to stop detecting the pattern. I think it relates to the proportion or the focal length.
The image below is the 100mm lens result.
Update 2
I added a sharpen filter to the large image, and it starts to fix the problem.
Firstly I used
//do a sharpen filter for the large resolution image
if (viewGray.cols > 1500)
{
Mat temp ;
GaussianBlur(viewGray,temp, Size(0,0), 105) ; //hardcoded filter size, to be tested on 50 mm lens
addWeighted(viewGray, 1.8, temp, -0.8,0,viewGray) ; //hardcoded weight, to be tested.
//imwrite("test"+ imageList[k][i], viewGray) ;
}
found = findChessboardCorners( viewGray, boardSize, ptvec,
CV_CALIB_CB_ADAPTIVE_THRESH + CV_CALIB_CB_FILTER_QUADS + CV_CALIB_CB_NORMALIZE_IMAGE + CV_CALIB_CB_FAST_CHECK);
Uploaded the image:
A jpg image at original resolution 3744 x 5616, if this site force convert, then make sure you are using at the correct resolution.
A few points.