Forums > Gen

jit.pix/jit.gl.pix color tracking (for the sake of efficiency)

April 2, 2014 | 10:56 am

Hello all!

Last night I made this quick patch to more efficiently track colors in the HLS colorspace (or RGB colorspace with a quick adjustment). The nice thing about it is that I can either use jit.pix or jit.gl.pix, depending on whether I would like it to run on the CPU or the GPU.

Along those same lines, I would now like to attempt to execute (single) blob centroid or bounds tracking within Gen. I hope that this will give me the efficiency and flexibility that I am looking for.

It seems like it should be possible. In the end it is all just a bit of math. As far as my understanding, which is admittedly not comprehensive, I will just need to divide the sum of the y coordinates of the white pixels by the number of total white pixels to get the centroid-y location and then divide the sum of the x coordinates of the white pixels by the number of total white pixels to get the centroid-x location.

I hope this is possible inside Gen and I don’t see why it wouldn’t be. Can someone please point me in the right direction for achieving this?

– Pasted Max Patch, click to expand. –
  • This topic was modified 4 months by  bpcook.
  • This topic was modified 4 months by  bpcook.

April 16, 2014 | 11:03 am

With Gen, you can’t output data that doesn’t conform to the same dimensions as the input matrices. When doing blob tracking, you typically output a changing list of values depending on how many blobs are detected. You input is going to be an image. These sizes of these values are very different. In short, this kind of computation isn’t what Gen is suited for.


April 18, 2014 | 8:18 am

Makes sense! Oh well. Thank you!


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