Analyzing hue after threshold on brightness

Posted by pepe86 on
URL: http://imagej.273.s1.nabble.com/Analyzing-hue-after-threshold-on-brightness-tp5012575.html

Dear community,
I have not much experience with ImageJ yet, but I am sure that some of you can solve my problem within a few minutes.

I have an image of which I need to get the frequency of different hues, but first I want to remove pixels with low brighness (background). So the aim is to get a list of hue values of an image after applying a threshold on the brightness of the pixels. Preferably using a Macro.

My idea was to split the imge in HSB, set the threshold on the brightness channel, use the selection as a ROI, go back to the hue channel and export the list of values from the histogram.

The problem I am facing is that the threshold that I set in the brightness channel is also appearing in the hue channel, which means that also the hue histogramm is thresholded, not only brightness.

So my question is, how to use the brightness channel to create a ROI, which I then use on the (not thresholded) hue channel. I am also open for completely different strategies, as long as they lead to the aim stated above. Is it maybe possible to set the brighness threshold directly in the RGB image and retrieve the hue histogramm without the need to create a ROI?

Looking forward to hearing your ideas.
Pepe