Login  Register

Re: Batch color thresholder

Posted by ram prasad on Sep 02, 2015; 10:41am
URL: http://imagej.273.s1.nabble.com/Batch-color-thresholder-tp5014215p5014225.html

Hi Oli,

I'm not sure why the images were not attached because I can see it in my
original email to the group. Anyway, herewith I'm attaching the images
again.

I have only three colours in my image -blue,yellow and black- and blue and
black are a bit far apart in the hue scale. So, I think I can be a bit
relaxed with my hue settings and this should take care of that potential
risk arising from less saturated images don't you think?

Also, I haven't had any luck with obtaining the desired selection and I'm
not sure where I am going wrong. Would you be kind enough to write me a
macro so that I can see what I'm doing wrong? That would be very helpful.

Thank you very much.

Best,
Ram

On Wed, Sep 2, 2015 at 11:32 AM, Burri Olivier <[hidden email]>
wrote:

> Hi Ram,
>
> Your images were not attached, by the way.
>
> Selecting "macro" creates the macro code, but you still need to run it
> separately to obtain the desired mask.
>
> As you say, saturation will give you an idea as to how 'pure' your yellow
> is, which is a good indication if you are going towards 'pale' as you say.
> But I cannot say without an image to look at. The risk I see is that is
> less saturated images, you might not be able to pick up your hue as well,
> decreasing the number of pixels for the saturation measurement. Perhaps
> using the 'brightness image' to select only the parts of the wing with
> bright elements and then measuring the saturation regardless or hue could
> work? I suggest you try both manually and see if you get the same result?
> Again I'd be happy to have other's opinion on this.
>
> Ideally if you want to go through this quantitative route, you need some
> sort of internal control for the intensity/colors. Usually people use a
> color palette taken in conjunction with the image so that in case the white
> balance changes or overall illumination is modified, these can be corrected
> before proceeding with quantification. Something like this:
> http://scientific.datacolor.com/products/macro-calibration-target/
>
> Finally, if you have tried transforming your RGB image to HSB
> (Image->Type->HSB Stack), you will have noticed some nasty artifacts,
> especially in the saturation image. This is the problem with
> 1. JPEG compression creating artifacts due to the nature of the
> compression algorithm.
>
> 2. Potential oversaturation of the image by the camera to make the image
> more 'appealing'. This often happens unbeknownst to the user.
>
> So please always work in RAW formats to avoid these kinds of issues. You
> will most likely get a significant difference in your metric, as it is
> probably clear cut, but the data quality could be deemed insufficient
> because of the JPEG compression. So it is at your own risk.
>
> Best
>
> Oli
>
>
>
> > -----Original Message-----
> > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> > ram prasad
> > Sent: Wednesday, September 2, 2015 10:42
> > To: [hidden email]
> > Subject: Re: Batch color thresholder
> >
> > Hi Oli,
> >
> > Thank you very much for your response.
> >
> > When I select "Macro" from the threshold color, it gives me a macro code
> > and a red coloured mask on the area of my interest. However, when I try
> to
> > create a selection on this mask I get the error I mentioned in the first
> mail in
> > this thread.
> >
> > "However the question remains on what you are trying to measure on your
> > original RGB image. From what I gather if you measure inside a
> selection, you
> > will get the average of the red green and blue channels where you want
> the
> > 'yellow color intensity' which is not really that."
> >
> > I was under the impression that selecting yellow pixels with the hue
> slider
> > should give me a selection that has only yellow pixels. That way when I
> > measure saturation I should get the intensity only for the yellow pixels?
> > I'd like your opinion on this one.
> >
> > Herewith, I have attached two images that show a difference in the
> intensity
> > (one is yellow and the other one is pale), for your reference.
> > This difference is what I would like to measure.
> >
> > Best,
> > R
> >
> >
> > On Tue, Sep 1, 2015 at 5:12 PM, Burri Olivier <[hidden email]>
> wrote:
> >
> > > Hi,
> > >
> > > If you select "Macro" from the Threshold Color window, it will give
> > > you a macro code you can run and get a mask that you can use "Create
> > > Selection" on
> > >
> > > However the question remains on what you are trying to measure on your
> > > original RGB image. From what I gather if you measure inside a
> > > selection, you will get the average of the red green and blue channels
> > > where you want the 'yellow color intensity' which is not really that.
> > >
> > > I'd like others' opinions on this, but a better approach once you have
> > > your mask is to measure the Brightness component of your original
> > > image converted to HSB stack (Slice 3).
> > >
> > > Best
> > >
> > > Oli
> > >
> > >
> > > > -----Original Message-----
> > > > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf
> > > > Of ram prasad
> > > > Sent: Tuesday, September 1, 2015 16:08
> > > > To: [hidden email]
> > > > Subject: Batch color thresholder
> > > >
> > > > Hi all,
> > > >
> > > > I would like to quantify yellow colour intensity on a number of
> > > > images,
> > > but I
> > > > am having trouble writing a macro for that purpose.
> > > >
> > > > I can get as far as opening the colour thresholder and applying my
> > > cut-off's
> > > > but then selecting the region of interest is a bit slippery and I'm
> > > hoping you
> > > > guys can help me out with this.
> > > >
> > > > This is what I'd intended to do.
> > > >
> > > > 1) Create a duplicate of my image  (Image -> Duplicate)
> > > > 2) Open the thresholder and select yellow pixels using the hue
> > > > slider
> > > (Image -
> > > > > Adjust -> Threshold)
> > > > 3) Then create a selection (Edit -> Selection -> Create selection)
> > > > 4) Restore the selection on the original image (Edit -> Select ->
> > > > Restore
> > > > selection)
> > > > 5) Finally, measure Integrated density using (Analyze -> Measure)
> > > >
> > > > The problem I have with the third step is that when I try to create
> > > > a
> > > selection
> > > > (using Edit -> Selection -> Create Selection) I get a pop-up with
> > > > the
> > > following
> > > > message,
> > > >
> > > > "This command creates a composite selection from a mask or from an
> > > > image that has been thresholded using Image -> Adjust ->Threshold
> > > > tool. The current image is not a mask and has not been thresholded"
> > > >
> > > > I'm not sure why I'm getting this error here as I used Image ->
> > > > Adjust
> > > > ->Threshold to threshold my image.
> > > >
> > > > I'm attaching a sample image here for your reference. Please let me
> > > > know
> > > if
> > > > you need more information from my side.
> > > >
> > > > P.S the click operation on the Select button in the thresholder
> > > > dialog
> > > box
> > > > does not get recorded in the macro recorder that's why I'm resorting
> > > > to
> > > Edit -
> > > > > Select -> Create selection to create a selection.
> > > >
> > > > Thanks,
> > > > R
> > > >
> > > > --
> > > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > >
> > > --
> > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > >
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html