I have the code
img = cv2.imread(\"poolPictures\\chessboard3.jpg\", cv2.IMREAD_COLOR)
chessboardImage = cv2.imread(\"poolPictures\\chessboardActual.jpg\", c
As Zenith042 pointed out, I had image points and object points the wrong way round. However, the main issue was that instead of a numpy array for my image points like:
[[[ 137.5 205. ]]
[[ 143.5 206.5]]
.
.
.
[[ 137.5 209.5]]]
I instead needed:
[[ 137.5 205. ]
[ 143.5 206.5]
.
.
.
[ 137.5 209.5]]]
Which I achieved with:
ret, corners = cv2.findChessboardCorners(img, (9,6), None)
corners = np.array([[corner for [corner] in corners]])
although I suspect there is a nicer way with numpy.reshape.
I also needed the same structure for the object points, i.e.
objp = np.array([objp])