Camera filters in OpenCV

Camera filters in OpenCV

OpenCV University

1 год назад

10,047 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@finno867
@finno867 - 24.02.2024 09:21

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)

Ответить
@Official.chukwuemekajames
@Official.chukwuemekajames - 08.07.2024 13:47

Create something better. It seems you are just reading the code.

Ответить