Help with Colour tracking ?

Jonathan's icon

Hello. I'm working on a project where I'd like a png image to follow a certain colour, so say if the colour I was holding up to my webcam moved left the image would follow. I've succeeded in patching a colour tracking device with the help of some reference patches and looking online to see what others have done, but I'm having trouble getting my image to follow the colour. I've been trying it with jit.lcd but nothing I'm trying is working very well :'(

If anyone has any example patches or tips on objects that might work I'd be very thankful if you'd share.
Thank you.

carsol's icon

hi Jonathan, how you get the coords of the tracked color? jit.findbounds? cv.jit? or... ? the best is that you post the patch...

Jonathan's icon

I was thinking of using this example patch from the jitter recipes if i'm not mistaken ( https://cycling74.com/wiki/index.php?title=Jitter_Recipes )

Max Patch
Copy patch and select New From Clipboard in Max.

carsol's icon

there are many ways to achieve what you looking for, here you have a patch that tracks red color using jit.findbounds and draw a square using jit.lcd. adjust tracking color with min/max attributes of findbounds...

if you want display an image, probably you can do it with the same jit.lcd but jit.gl.sketch is the best way to go in any case...
the help file is very self explanatory about how yo draw with it, but drop a message if you in troubles... good luck..

Max Patch
Copy patch and select New From Clipboard in Max.

Jonathan's icon

Thanks a lot !