I have been able to generate a list of coordinates that i would like to use as the centres of mulltiple small circles that i would like to plot on an image.
I am able to plot circles at individual points but have not been able to find the correct syntax for plotting circles at all of the centres. The coordinates i wish to use for the centres are stored as follows, in an array named Points which has a shape :(11844, 2)
[[ 5 5]
[ 5 10]
[ 5 15]
...,
[630 460]
[630 465]
[630 470]]
I am able to plot an individual circle by using the following code:
cv2.circle(frame1,(5,5),1,(0,0,255))
I have tried to plot all points by using :
cv2.circle(frame1,Points[:,:],1,(0,0,255))
This gives back this error though:
cv2.circle(frame1,Points[:,:],1,(0,0,255))
SystemError: new style getargs format but argument is not a tuple
Am i supposed to be using a loop to step through all the points and plot them one by one? If so which loop should I use? Or is there something simple that i am missing?
I managed to find the answer with help from Joel using the following code:
for point in Points:
cv2.circle(frame1,tuple(point),1,(0,0,255))
Try this, it should work:
for point in Points:
cv2.circle(frame1, point, 1,(0,0,255))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With