Greenness of an RGB image

29 views (last 30 days)
nyx1888
nyx1888 on 2 Mar 2014
Edited: John D'Errico on 3 Mar 2014
Hi,
in an other thread I found this equation to compute the "greenness" of an RGB image:
greenDifference = abs(greenChannel - (redChannel + blueChannel)/2);
Can anybody name a literature source for this equation? I desperately need a source for my master thesis.
Thanks for your help.

Accepted Answer

John D'Errico
John D'Errico on 2 Mar 2014
Edited: John D'Errico on 3 Mar 2014
As Image Analyst has said, it is just something well known and logical. Thus a high green component makes for a greenish color. A low value for (red + blue) also makes for green-ness. Is this exact? Not really, merely a good measure that will correlate with perceived green-ness.
I would suggest that someone made a rather large mistake when they formulated that expression. (Assuming RGB is scaled over the range [0,255].) The color [0 255 0] is a green. However, this formula, because of the abs, would also call [255 0 255] a greenish color, when clearly that is not at all green, in fact, a deep purple, so anti-green.
A better expression would arguably be to remove the abs:
greenDifference = greenChannel - (redChannel + blueChannel)/2;
Here green-ness can go negative, in fact we could have a green-ness measure that varies over the range [-255,255], with 255 as the maximum green-ness, and -255 as a maximal anti-green.
(If your image is scaled [0,1], then the green-ness measure here would vary from -1 to 1.)
If you preferred a measure that is scaled on the interval [0,255], then a good measure would be to transform it as:
greenDifference = (255 + greenChannel - (redChannel + blueChannel)/2)/2;
A similar version would work for images scaled over [0,1].
And finally, if your numbers are uint8, then you need to beware overflows and underflows. So you might convert first to int16 (or even a floating point representation) to avoid those failures.

More Answers (1)

Image Analyst
Image Analyst on 2 Mar 2014
That's one definition. There are others It's one of those things that doesn't really need a citation. It's like saying you are going to threshold an image, or do a morphological closing, or some other basic operation. They're so basic that there may not be any articles on just that. It's like saying that you want to find changes between two images (two timepoints of the same scene) and saying you want to subtract them. Sure, there are tons of papers that use subtractions but you probably won't find a seminal paper that says here's why a subtraction is valid - it's just something everyone knows.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!