Programmer100 February 2016

Python OpenCV TypeError : "corners is not a numpy array, neither a scalar"

Running OpenCV findChessboardCorners, I get this error:

ret, corners = cv2.findChessboardCorners(_Image, size, cv2.CALIB_CB_ADAPTIVE_THRESH+cv2.CALIB_CB_FAST_CHECK+cv2.CALIB_CB_NORMALIZE_IMAGE)
TypeError: corners is not a numpy array, neither a scalar

This is my relevant code:

size = (10,6)
_Image = cv2.imread(filePath, 0)
ret, corners = cv2.findChessboardCorners(_Image, size, cv2.CALIB_CB_ADAPTIVE_THRESH+cv2.CALIB_CB_FAST_CHECK+cv2.CALIB_CB_NORMALIZE_IMAGE)

Answers


Berriel February 2016

Maybe, you should do this:

ret, corners = cv2.findChessboardCorners(_Image, size, flags=cv2.CALIB_CB_ADAPTIVE_THRESH+cv2.CALIB_CB_FAST_CHECK+cv2.CALIB_CB_NORMALIZE_IMAGE)

Based on the docs, the third parameter is corners and looks like you were expecting it to be flags.

Post Status

Asked in February 2016
Viewed 2,604 times
Voted 10
Answered 1 times

Search




Leave an answer