Accessing a spreads values - VL.OpenCV

Hi Everyone! I am new here and only started working with vvvv recently. Right now I am trying to work with the vl.OpenCv plugin. In the examples tracking is shown/ade visible with a rectangle. The output of the tracker is therefore a Rectangle [2D] but I would like to convert it to vectore 2 or access the values separetly as I want to control some graphics with the tracking.

Would be super happy for any suggestions or answers! :)

Hi @JelenaM , welcome to the forums!

If what you want is to extract the position of the detected object, you can use the Rectangle’s Center for example (or top/left, or what makes more sense in your application).

To get this just open the node browser, type in Rectangle, click on the first entry (looks a bit like a folder), and in the list that comes up you should be able to find Center:

image

This will give you a Vector2 which you can then Split to get the individual X and Y components.

Keep in mind that if you need to process a List or Spread of Rectangles, you will probably need a ForEach region. If you are not familiar with it, there are good intros in the Help Browser explaining how to use it.

I hope that helps!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.