I am trying to find the corners of a chessboard using OpenCV.
The image I use contains two chessboards, but I'm only interested in the subregion of one of them. The following image shows the original image.

Using GIMP, I selected the area of โโinterest, and I set all other pixels to the default value.

I actually did not crop the image because I already calibrated the camera using this image size and I did not want to change it. The operation should be equivalent to changing the values โโin the image matrix, but I preferred to do this using GIMP. This is a one-time experiment, and itโs faster to use this operation with a graphical tool instead of using code.
The resulting image contains a chessboard with angles of 24x5, but the findChessboardCorners function cannot find anything.
Here is the Python code I'm using:
>>> img = cv2.imread('C:\\Path\\To\\C4-Cropped.png', 0) >>> cv2.findChessboardCorners(img, (24, 5)) (False, None) >>> cv2.findChessboardCorners(img, (5, 24)) (False, None)
I also tried setting the adaptive threshold, but it still does not work
>>> cv2.findChessboardCorners(img, (24, 5), flags=cv2.cv.CV_CALIB_CB_ADAPTIVE_THRESH) (False, None)
It seems really weird. I have used this OpenCV feature many times in the past and have always worked, even with images that looked much more complicated than this. The coverage of the area is not uniform, but the function must be strong enough to handle it.
Is there a problem with the artificial image created by ad hoc with GIMP? How to find the corners?
Any suggestion would be greatly appreciated.