Forums > Jitter

extracting x and y coordinates from cv.centroids

October 11, 2006 | 12:25 pm

I have a patch in which I change my camera input to a binary image. Next, when I use cv.jit.centroids and put an object in front of the camera, it will show a red cross in the center of this object.

How can I extract and show the x and y coordinate of this cross in Max/MSP? I can’t figure it out.

Also, if there’s a better way to find coordinates of the center of an object, please let me know. What I want to do is change the x and y offset by using the coordinates of the center point of the object to get the object centered in my jit.pwindow.


October 11, 2006 | 12:36 pm

download the new cv.jit.
almost every object has an abstraction which uses jit.lcd to visualize the
data. centroid outputs the x,y and total area of blobs.
the abstraction uses jit.iter to unpack this data to the lcd

2006/10/11, Bart :
>
>
> I have a patch in which I change my camera input to a binary image. Next,
> when I use cv.jit.centroids and put an object in front of the camera, it
> will show a red cross in the center of this object.
>
> How can I extract and show the x and y coordinate of this cross in
> Max/MSP? I can’t figure it out.
>
> Also, if there’s a better way to find coordinates of the center of an
> object, please let me know. What I want to do is change the x and y offset
> by using the coordinates of the center point of the object to get the object
> centered in my jit.pwindow.
>
>


October 11, 2006 | 1:53 pm

Hi yair r.,

Thanks for your reply.

I’m having difficulties making it work.

I have my metro banging to the jit.lcd 4 char 160 120

cv.jit.centroids.draw is connected to the top left input of jit.lcd as well and jit.lcd is connected to the left input of jit.iter and a jit.pwindow. I don’t see how I can unpack the data from jit.iter.

I’ve tried several connections, switched cords but I don’t understand what needs to be connected.

From what I understand from you the jit.lcd needs to visualize the data it gets from jit.centroids. Next, jit.iter unpacks this data from jit.lcd. Or, does jit.iter have to be connected to jit.centroids to get the data to jit.lcd?

I’ve checked the demo patch of jit.lcd and it shows something similar I need..only it does it for the mouse coordinates. I need it to do the same but for the centroid (red cross) coordinates.


October 11, 2006 | 3:59 pm

hi bart, i think you have to go back a bit. double clicking on the
centroid.draw object will reveal its internal workings, it is not an object
but an abstraction. inside you will find some more questions :)

when reverse engineering a patch use print, jit.cellblock/jit.print/pwindows
to find what is goind on between blocks. every max/jitter/msp object has a
set of data types it accepts. pwindow accepts matrices but not lists, this
has to go to a lcd for processing into a data type pwindow will understand,
this is a simplification, check out the tutorials pdf , they are very good.

2006/10/11, Bart :
>
>
> Hi yair r.,
>
> Thanks for your reply.
>
> I’m having difficulties making it work.
>
> I have my metro banging to the jit.lcd 4 char 160 120
>
> cv.jit.centroids.draw is connected to the top left input of jit.lcd as
> well and jit.lcd is connected to the left input of jit.iter which is
> connected to a jit.pwindow.
>
> My Max window tells me: jit.pwindow doesn’t understand list.
>
> I’ve tried several connections, switched cords but I don’t understand what
> needs to be connected.
>
> >From what I understand from you the jit.lcd needs to visualize the data
> it gets from jit.centroids. Next, jit.iter unpacks this data from jit.lcdto a
> jit.pwindow? (lcd) Or, does jit.iter have to be connected to jit.centroidsto get the data to get the data to
> jit.lcd?
>
> I’ve checked the demo patch of jit.lcd and it shows something similar I
> need..only it does it for the mouse coordinates. I need it to do the same
> but for the centroid (red cross) coordinates.
>
>
>


October 13, 2006 | 6:33 pm

I found my answer (i think) in a different way. Maybe it’s useful to others.
I just use unpack to extract the x and y coordinate from cv.jit.centroids.


Viewing 5 posts - 1 through 5 (of 5 total)