I have two related problems and have tried the suggestions given to similar problems and have not been able to resolve them.
First of all, what I'm trying to do is to draw circles for key points that I keep as floating numbers in two separate NumPy arrays for the h and v coordinates on an image. For this purpose, I use the code snippet I have specified below(H for horizontal, V for vertical):
for h, v in zip(H.astype(int), V.astype(int)):
color = choose_random_color(seed)
image_withkeys = cv2.circle(image_withkeys, (h, v), 10, color, -1, cv2.LINE_AA)
where image_withkeys is just the copy of the initial image, H and V are horizontal and vertical positions as floating number NumPy arrays respectively.
When I want to run the code as it is, I get the following error:
cv2.error: OpenCV(4.5.4) :-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
As can be seen in the error text, I am using 4.5.4 as the cv2 version. In one of the posts I've seen someone said:
Because opencv 4.5.2 has made a backwards-incompatible change without bumping their major version. This would break with your existing code. Try opencv 4.1.1
You can see the whole tread here.
Is there a way to set the cv2 version on a different version that will support the code I wrote? Or should I use a different method for integer casting? I am open to any suggestions.
Thanks in advance.