Is it possible to retrieve the pixels of an image using the currently available nodes in the nodes library?

Below is a simple motion sensor sketch but I would like to get the average 2D points of pixels that are not black. If I can do this I could then place a marker on the image and track the moving object in Vuo coordinates.


Thanks for your help Jean

marcorexo1's picture
Submitted by

Thanks for your help Jean Marie.

I would like to access the raw pixels so that I can use their coordinates - clearer below.

For example, in the image below I know the coordinates of every white pixel, and through averaging their x and y positions I can calculate the centre of mass (3,3) . I'd like to perform this method on a thresholded video image so that I can place a marker at the centre of mass of the moving object.

I need to learn to create my own nodes, but at this point I was playing around with readily available ones.

There is a feature request

jmcc's picture
Submitted by

There is a feature request for Tracking blobs, or "finding the image's centroid", which is what we think you are asking. One of my teammates created a composition that samples many colors from the image inside a Process List loop, then take the average of the sampled point positions weighted by the brightness at each position.

Implementing the feature request should provide better performance and better resolution, and more advanced region detection.

MM ListTools isn't deprecated

jersmi's picture
Submitted by

MM ListTools isn't deprecated :)

Had a feeling someone might say that -- should have said “a node that will not open on my (M1) machine”, wonder why....

Jean Marie -- that is a very good comp to see. Kinda wishing examples like this from Team Vuo could (also) be in the composition library….

Edit: attached a comp, added some smoothing in attempt to address blob jitter. More could be done.

Hi jersmi, Jean Marie, Joe

marcorexo1's picture
Submitted by

Hi jersmi, Jean Marie, Joe

My iMac broke yesterday just as I started on this...

So here's my own version based on the grid system.

Method: 1. Creates a 10x10 grid over the video frames. The grid acts like a CCD sensor. 2. Loop over the grid, sample the colour at each coordinate and width, and colorise the corresponding grid element with an average colour. 3. If it is greater than black (0) then obtain the grid(s) coordinate and dimensions 4. Overlay a rectangle with this position and dimension. 5. Aimed result: a rectangle which adjusts its size and location in relation to the blob in the video...smoothing filter for rectangle motion not implemented here.

Problems: 1. Seems to be a glitch in the way the grid are colored - some reddening to the top grids 2. Interference from 1 causes the resulting green rectangle to jump about a bit 3. My composition is a bit slow so I;ve had to reduce the video rate.

Can you guys help with the problems?