I made this object a while ago to track red and blue, but it can be extended to track other pure colors:

http://www.jaimeoliver.pe/archives/645

best,

J

On Sun, May 23, 2010 at 1:00 PM, Mathieu Bouchard <matju@artengine.ca> wrote:
On Sat, 22 May 2010, Ryan Trigg wrote:

I am currently trying to find a way to isolate a colour in a live video stream.  For example, if I chose red, any object in the video that does not contain red (above a certain threshold) would be black.  Does such an object exist in GEM?  Thanks for your help.

[pix_colormatrix] is very good for that stuff. Optionally you can combine it with [pix_threshold] or others.

[pix_colormatrix] allows you, for example, to do things like new_red = old_red - old_green - old_blue, in order to identify redness in a way that excludes yellow, purple and white. You'd make a column with constants 1, -1, -1.

For singling out other colors you would use those numbers in a different order, or the numbers 1, 1, -2 in any order (for secondary colors), or any other combination (for finding other colors).

 _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801

_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list




--
Jaime E Oliver LR

www.jaimeoliver.pe

858 750 0924 (cel)
858 202 1522 (home)
9168 Regents Rd. Apt. G
La Jolla, CA 92037
USA