Комментарии:
Great tutorial series!
Just a note for anyone that is receiving the following error using the provided code:
Exception has occurred: error
OpenCV(4.9.0) :-1: error: (-5:Bad argument) in function 'circle'
> Overload resolution failed:
> - Can't parse 'center'. Sequence item with index 0 has a wrong type
> - Can't parse 'center'. Sequence item with index 0 has a wrong type
You can resolve it by casting the x and y coordinates to integers before passing them to cv2.circle():
if corners is not None:
for x, y in numpy.float32(corners).reshape(-1, 2):
cv2.circle(result, (x, y), 10, (0, 255, 0), 1)
Should become:
if corners is not None:
for x, y in numpy.float32(corners).reshape(-1, 2):
cv2.circle(result, (int(x), int(y)), 10, (0, 255, 0), 1)
Create something better. It seems you are just reading the code.
Ответить