OpenCV drawing circles

Hi, I am new to TD.
In OpenCV, it is possible to draw a circle on a picture, but how do I do the same thing in TD?
This is my code.

img = op('moviefilein1').numpyArray() color = (0, 0, 255) pt = (100, 100) cv2.circle(img, pt, 10, color, -1)
I found out that moviefilein1 does not change at all, but when I use cv2.imshow to show the image, it did draw a circle on it but moviefilein1 which display in TD didn’t. Moreover, the image that cv2.imshow shows is upside down and also strange colors.
Does anyone know how to do it on the right way? Thks!

op(‘moviefilein1’).numpyArray() just reads values from the TOP, it does not set them.

Currently there is not yet a method in TD to create TOPs from a numpyArray directly.
The only options are either to create a CHOP first (see the OpenCV wiki page for an example) and then use a CHOP to TOP operator.
Or write the file to disk in opencv and open it with a Movie File In TOP.
Also see this thread, Derivative is working on a method to create TOPs from numpyArrays.

So until that time, a Circle TOP with an Add TOP will be faster to add a circle to your picture :wink:

Thanks for your reply!
The reason why I want to draw circle on the image is because I want to create a minimap.
I have a route map and I want to track the route’s color and add a circle on it to show the location. The only way I figure out is to use openCV.
If I add an circle TOP on the image, how do I move the circle along the route?

Then a Circle TOP will be a much faster solution, as that is a single shader.
You can move it by animating the values of its centerx and centerx parameters.

For that, see this tutorial about how to control nodes with values from other nodes.

matthewragan.com/2014/06/01/und … chdesigner