## Most Prominent colour? (not jit.3m)

Apr 10 2007 | 10:23 pm
I am looking for a way to look at a matrix and see the most prominent colour or section of colours.
I don't want the average colour on screen, like, say you have a big red field and a smaller blue field in the matrix. If I apply jit.3m I will basically get a violet colour as the RGB mean. I would like to output "red" in this example.
Would jit.histogram or jit.colorspace be helpful here?
Cheers, Andreas.

• Apr 10 2007 | 10:42 pm
If you want the most frequent color, jit.histogram is the object you need.
wes
On 4/10/07, Andreas Wetterberg wrote: > I am looking for a way to look at a matrix and see the most prominent > colour or section of colours. > > I don't want the average colour on screen, like, say you have a big red > field and a smaller blue field in the matrix. If I apply jit.3m I will > basically get a violet colour as the RGB mean. I would like to output > "red" in this example. > > Would jit.histogram or jit.colorspace be helpful here? > > Cheers, > Andreas. >
• Apr 11 2007 | 5:19 am
Hi Wes, Yes, histogram helps me clearly visualize what's going on with regard to colour in the matrix, but I honestly don't have any idea how to automatically extract an RGB value from histogram that says "THIS is the most prominent value". Any pointers to send me in the right direction, and I'll happily patch it up for yall.
cheers, Andreas.
Wesley Smith skrev: > If you want the most frequent color, jit.histogram is the object you > need. > > wes >
• Apr 11 2007 | 5:34 am
Actually now that I look at it, jit.histogram isn't quite what you want because it does per-plane binning. The only way I can think to do it with standard jitter objects is to somehow make the 3 color planes into a single plane of unique values per color triplet my making a long with its 32 bytes as the ARGB char values. That's a pain to do. Seems like what you want calls for a custom external. Perhaps someone else has a better idea?
wes
• Apr 11 2007 | 7:21 am
Colorspace conversion? For example jit.rgb2hsl and then use jit.histogram to extract the hue plane info?
M.
Wesley Smith wrote: > Actually now that I look at it, jit.histogram isn't quite what you > want because it does per-plane binning. The only way I can think to > do it with standard jitter objects is to somehow make the 3 color > planes into a single plane of unique values per color triplet my > making a long with its 32 bytes as the ARGB char values. That's a > pain to do. Seems like what you want calls for a custom external. > Perhaps someone else has a better idea? > > wes > >
• Apr 13 2007 | 6:39 am
jit.rgb2hsl + jit.histogram is the way to, but you will run into problems with multi-modal distributions. For example, take the following hue values:
0: 2 1: 2 2: 2 3: 2 155: 6
If you just look at the highest value, it would appear that blue (155) with 6 pixels is the most prominent colour. However, values 0 to 3 (red) account for 8 pixels, so there is really more red than blue.
• Apr 13 2007 | 11:43 am
and that's where jit.charmap might come in handy, no?
On Apr 13, 2007, at 8:39 AM, Jean-Marc Pelletier wrote:
> > jit.rgb2hsl + jit.histogram is the way to, but you will run into > problems with multi-modal distributions. For example, take the > following hue values: > > 0: 2 > 1: 2 > 2: 2 > 3: 2 > 155: 6 > > If you just look at the highest value, it would appear that blue > (155) with 6 pixels is the most prominent colour. However, values 0 > to 3 (red) account for 8 pixels, so there is really more red than > blue.
• Apr 13 2007 | 12:24 pm
This sounds really really exciting for me. If anyone cracks this in a patch I'd be so psyched!
Andreas _:
nesa skrev: > and that's where jit.charmap might come in handy, no? > > On Apr 13, 2007, at 8:39 AM, Jean-Marc Pelletier wrote: > >> jit.rgb2hsl + jit.histogram is the way to, but you will run into >> problems with multi-modal distributions. For example, take the >> following hue values: >> >> 0: 2 >> 1: 2 >> 2: 2 >> 3: 2 >> 155: 6 >> >> If you just look at the highest value, it would appear that blue >> (155) with 6 pixels is the most prominent colour. However, values 0 >> to 3 (red) account for 8 pixels, so there is really more red than blue.
• Apr 13 2007 | 2:34 pm
here's one quickie:
cheers, nesa
• Apr 13 2007 | 6:19 pm
nesa skrev: > here's one quickie: AWESOME!
And, since I just got word that my little shipment of 6 big RGB LED par lamps is coming early next week, I will definitely do some testing with video controlling the RGBs. (*school-girlish giggle*)
Andreas.
• Apr 13 2007 | 6:25 pm
I can't think of any approaches using the standard Jitter objects. You could program an object in Java or C that loops through the image, counting the instances of each color. I would recommend that you limit the range first, though, perhaps to 1000 colors by dividing by 25 and then multiplying by 25.
Jeremy
On Apr 11, 2007, at 3:21 AM, marco lorenzin wrote:
> Colorspace conversion? For example jit.rgb2hsl and then use > jit.histogram to extract the hue plane info? > > M. > > Wesley Smith wrote: >> Actually now that I look at it, jit.histogram isn't quite what you >> want because it does per-plane binning. The only way I can think to >> do it with standard jitter objects is to somehow make the 3 color >> planes into a single plane of unique values per color triplet my >> making a long with its 32 bytes as the ARGB char values. That's a >> pain to do. Seems like what you want calls for a custom external. >> Perhaps someone else has a better idea? >> wes > > >