Problems in measuring Hue of photos

Hey there,
I’ve experienced a problem when measured the colour of grapes using ImageJ.

As the photos taken are affected by light, to get a relatively objective colour of the grapes, I’m measuring Hue values instead of RGB.
What I’m doing is:
select the grape area using ‘colour threshold’ --> separate the images into three channels (hue, saturation and brightness) using ‘stacks to images’ to get the separate Hue channel -->measure the Hue value to get the mean Hue.
However, after separating, the dark grapes (due to shrivel) become into white colour (image below) and have very high Hue values. I don’t quite understand why. Strangely, some grapes that are also dark but not so much remain dark after separation and have very low Hue values. This creates problems for my data analysis and I cannot interpret the data in this case. Anyone knows why does this happen, and how to fix it? Is there a threshold for darkness that when it’s darker, the Hue is higher while when it’s lighter, the Hue is lower?

Thanks in advance for your patient reading this!

Hi @Summer,
the hue-values of the “dark” grapes are high because they are in the magenta range of hue values, i.e. between blue and red. Have a look at the Hue histogram of the Threshold Color tool. Also the hue-scale is circular, reddish tones will have a very high or very low hue.
Best regard,

1 Like


You will find explanations there:

1 Like

Thank you Volker, yep you are correct. In this case, seems Hue is not the best for measuring my imagery. Would you know if there’s other measurements to objectively quantify the colour?


Thanks Mathew for the link, it explains the problem well.

Hi @Summer,

I’m not in the field, but it seems that hsb and cielab are generally used for measuring the colors of fruits. The hue seems to be a good property for the colors of the grapes in your image, you would just have to map the intervals of the hue to colors, instead of using higher and lower value.
But I would have to know more about what you want to achieve in the end…
Best regards,

Hi @Summer
Can you redeposit an original photo without annotation (circles): thank you.

As written: @volker

But I would have to know more about what you want to achieve in the end…

If you want to detect the “rot” of the grape then I advise you to test the plugin: RGB —> CMYK

Hi @Mathew Mathew,
Please find the photo:

also @volker, What I want to achieve is to examine the influence of sunlight on grape colour. So the assumption is that grapes with more sunlight would have darker colour (lower Hue value), but now the ‘rot’ like grapes mess up the results by giving higher Hue value.

Heaps of thanks to you both!