Examples of colours' range for jit.findbounds?

Muggsy's icon

Hi everybody!
I have been searching the web and the forum but I cant find anything interesting.

A quick description of the project: Im using Max to react to colours picked up by a videocamera.

Im actually struggling with jit.findbounds... in fact, I want it to recognise certain colours.
So I used the tutorial 25 and copy/pasted the part dedicated to this purpose (the one with the turquoise background).
Now, the yellow is well recognised...

...But I wanted to set up myself other colours, which are green, blue, red and purple/pink. I made tries with the three RGB values to get appropriate ranges for those colours.
But when put the values in jit.findbounds, the result is quite strange...
It seems indeed that none of the ranges are working properly, as they all (except red recognising many colours...) tend to focus on the orange colour. Not sure though, as my tests gave other stranges results.

Here are the amounts I have (R/G/B/A):
- yellow (given by tuto 25): from 0/0.8/0.75/0 to 1/1/1/0.25
(Talking about that one, I don't really get how those values can depict yellow, but they do, so great)
- blue: from 0/0/0.5/0.5 to 0.3/0.4/1/1
- green: from 0/0.5/0/0.5 to 0.3/1/0.4/1
- red: from 0.5/0/0/0.5 to 1/0.3/0.3/1
- purple/pink: from 0.7/0/0.6/0.5 to 1/0/1/1

If anybody can give them a try, and/or explain me something I may have done wrong, please don't hesitate!
And if somebody has already set up those colours' ranges, and want to share the values, please do so :)

Don't hesitate to ask for more info!
Thanks a lot in advance.

spectro's icon

I think those values you are looking for are actually expressed as ARGB (in jit.findbounds etc) - rather than RGBA which might explain some of your confusion regarding finbounds settings. I recall a similar thread like this before and posted a patch to sample the colour of a movie/image as a point of departure for setting ranges. It might be some use- again. https://cycling74.com/forums/argb

Muggsy's icon

Thanks Spectro for your answer!!!
In fact I had already read that one, I now realise how interesting it is...

But thanks a million for this ARGB trick!!!
It works now!
Not perfectly fine, I still need to make it work properly, especially by playing with the jit.brcosa object which makes my green bottle turquoise (and so recognised as blue), but I can continue to work on the patch now.

Thanks again!