Totally new here. Color Counter question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Totally new here. Color Counter question

Emily Teng
Hello

I'm totally new to ImageJ and was hoping to get some guidance.  I have
pictures of plants (jpg) that I need to analyze to get percent of
coloring.  (Poinsettia plants.  I'd like to get the percentage of either
red/pink/white of the plants as it develops).  This is part of my
dissertation research.  I  have attached a sample image.  It looks like the
Color Counter Plugin would be the best way to go from what I can tell?  Is
this right?

If so, I don't understand what kind of processing I need to do to my
picture to get this to work.  And after that, I must have to customize the
plugin so that it knows which colors I want it to count, correct?  Since it
is not a clear red/pink, etc, I assume I would have to choose a range of
colors in the red range, or the pink range?

Is there documentation somewhere telling me how to do this?  Or can someone
help me with this?  I would really appreciate it.

Thank you so much for any help you can provide.

Emily

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

Freedom Red.jpg (484K) Download Attachment
Princettia Dark Pink 3 visible bud DSC_0114.JPG (2M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Totally new here. Color Counter question

Herbie
Good day Emily,

before you start thinking about any processing, you should be clear that you
can only consider leafs or parts thereof that actually are visible.

That said, I'm not sure what percentages you expect from images similar to
both of the provided samples in which the leafs overlap in an arbitrary
fashion.'m not sure if percentages measured from such samples are
meaningful.

Furthermore, you should avoid any additional structures that could be
recognized as leafs (according to their color) such as the ring-shaped metal
structure (which should better be white) and perhaps soil.

If you think that in spite of these concerns it is worth a try, then I
recommend to do a color transformation from RGB to CMYK.

You may get reasonable measures of the desired areas by thresholding the
color channels according to the automatic "RenyEntropy"-scheme. After
thresholding you can measure the selected area.

Yellow channel:     Estimate of the whole leaf area
Magenta channel:  Estimate of reddish leaf area
Cyan channel:       Estimate of greenish leaf area

Please make sure that you understand what the above processing means but
first of all, re-think, whether such measurements make sense at all.

Regards

Herbie



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Totally new here. Color Counter question

Robert Smith
In reply to this post by Emily Teng
Hello Emily,
Herbie is very good, however I feel he may be a little off for what you wish to do.​
I recommend you use the Process > Image Expression Parser(Macro). To use this you need to Image > Color > Split Channels (make sure to keep the original) then in the parser macro assign Red to A, Green to B, and Blue to C. Enter the equation in the field ,,,Sqrt(1-(A*A)/(B*B)) click OK. This will give you the B & W image in the attached. From there you can use any LUT you wish, then Histogram will give the percentage of the pixels at any of the colors used. This particluar LUT is the Physics(Inverted)​
This is accomplished by determining the ratio of the Green and Red channels, which will vary as they develope. It is basically the same technique that N.A.S.A. uses to determine the health of vegetation.​
Once you use it you can get a feel for if or when you may need to modify the equation. As the plant develops the green to red ratio will change which you can monitor as it does so.
Any further assistance need, just ask.
Bob

________________________________
From: Emily Teng <[hidden email]>
Sent: Wednesday, October 9, 2019 7:54 PM
To: [hidden email] <[hidden email]>
Subject: Totally new here. Color Counter question

Hello

I'm totally new to ImageJ and was hoping to get some guidance.  I have
pictures of plants (jpg) that I need to analyze to get percent of
coloring.  (Poinsettia plants.  I'd like to get the percentage of either
red/pink/white of the plants as it develops).  This is part of my
dissertation research.  I  have attached a sample image.  It looks like the
Color Counter Plugin would be the best way to go from what I can tell?  Is
this right?

If so, I don't understand what kind of processing I need to do to my
picture to get this to work.  And after that, I must have to customize the
plugin so that it knows which colors I want it to count, correct?  Since it
is not a clear red/pink, etc, I assume I would have to choose a range of
colors in the red range, or the pink range?

Is there documentation somewhere telling me how to do this?  Or can someone
help me with this?  I would really appreciate it.

Thank you so much for any help you can provide.

Emily

--
ImageJ mailing list: https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=02%7C01%7C%7Ca750c05aac1742d7358708d74d15d6fd%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637062628562843860&amp;sdata=Uv%2B4%2F14IJ2EAsWRJFCHT19dnEJDciy39V7BzP8lcDKk%3D&amp;reserved=0

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

2019-10-10.png (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Totally new here. Color Counter question

Herbie
In reply to this post by Emily Teng
Emily,

attached please find the reddish excerpts of your sample images.
<http://imagej.1557.x6.nabble.com/file/t380516/Freedom_Red_reddish.jpg>
<http://imagej.1557.x6.nabble.com/file/t380516/Princettia_Dark_Pink_3_visible_bud_DSC_0114_reddish.jpg>

"I'd like to get the percentage of either red/pink/white of the plants as it
develops"

It is up to you to decide what appears pink.
In your sample images I can't see any white parts of leafs.

Regards

Herbie




--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Totally new here. Color Counter question

Emily Teng
In reply to this post by Emily Teng
Dear Herbie,

Thank you for the helpful comments and suggestions.  I understand what you are saying about arbitrary leaf overlap but for my purposes it is still meaningful information.  I need a good estimate of percent coloration of the overall plant.

I only sent a pink and red example, and not a white example.  I assume the process would be the same?  

I am going to show my ignorance of the program as I don't know how to transform the picture to become CMYK.  

Step 2 - you say to "threshold the color channels according to the automatic "RenyEntropy"-scheme"  How do I do this?
 
Finally you say to that "After thresholding you can measure the selected area"  Again, I am just learning and don't know how to do this.

I'm afraid I need step by step directions on how to do these things.  They sound simple enough.  Unfortunately I am totally new and don't know how to do any of it.  If you could possibly give some more step by step directions, I would really appreciate it!

Emily

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Totally new here. Color Counter question

Emily Teng
In reply to this post by Emily Teng
Dear Bob,

Thank you so much for your suggestions.  Unfortunately, I am very ignorant on how to  use the program.  I don't know how to do most of you what you suggested.  First:

Process > Image Expression Parser(Macro).  Where is this?  Something I need to add?  I do know how to split the channels. ( Image > Color > Split Channels (make sure to keep the original)) but not how to use the parser macro to assign Red to A, Green to B, and Blue to C.


I guess the parser macro is where I am supposed to "Enter the equation in the field ,,,Sqrt(1-(A*A)/(B*B))?"

I see there are many LUTs but I don't know how to use them.  

If you have the time and could give more detailed step by steps on how to do this, I would really appreciate it.  I am learning, but have literally just downloaded the program a week ago and looked at a few tutorials so really know next to nothing....

Thank you so much.

Emily

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Totally new here. Color Counter question

Herbie
In reply to this post by Emily Teng
Good day Emily,

not sure if "white" can be detected or isolated in the same way...

As I wrote:
"Please make sure that you understand what the [...] processing means"

As with all tools, and ImageJ is a mighty tool, you should first study
the user manual. Here it is:
<https://imagej.nih.gov/ij/docs/guide/index.html>
There you find nearly everything you need except the "RGB >
CMYK"-converter plugin that you find here:
<https://imagej.nih.gov/ij/plugins/cmyk/index.html>
Download the "RGB_to_CMYK.class"-file and put it in the "plugins"-folder
of your ImageJ-installation.

Area measurements are made after thresholding (binarization) by "Create
Selection" and then using "Measure".

Please make sure you understand what color conversion and all the other
processing steps really mean. It is not a good idea to simply follow
step-by-step instructions (actually provided those before).

If you have studied the manual and still encounter problems with my
instructions, then please tell me exactly what works and what doesn't.

Regards

Herbie

::::::::::::::::::::::::::::::::::::::::
Am 16.10.19 um 00:08 schrieb Emily Teng:

> Dear Herbie,
>
> Thank you for the helpful comments and suggestions.  I understand what you are saying about arbitrary leaf overlap but for my purposes it is still meaningful information.  I need a good estimate of percent coloration of the overall plant.
>
> I only sent a pink and red example, and not a white example.  I assume the process would be the same?
>
> I am going to show my ignorance of the program as I don't know how to transform the picture to become CMYK.
>
> Step 2 - you say to "threshold the color channels according to the automatic "RenyEntropy"-scheme"  How do I do this?
>  
> Finally you say to that "After thresholding you can measure the selected area"  Again, I am just learning and don't know how to do this.
>
> I'm afraid I need step by step directions on how to do these things.  They sound simple enough.  Unfortunately I am totally new and don't know how to do any of it.  If you could possibly give some more step by step directions, I would really appreciate it!
>
> Emily
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Totally new here. Color Counter question

Robert Smith
In reply to this post by Emily Teng
Hello Emily Teng,
Attached you will find a 'macro' which is a small subprogram to Fiji/ImageJ which will do as I described.
You will need to download and copy it.
Goto  Plugins > New > Macro and click it. It will open a notepad type page. Paste your copy onto the page, save it as "Image Expression" in the Fiji/ImageJ folder - Macros in the Fiji/ImageJ app on your computer.
Then goto  Plugins > Macros > Install, choose it from the list and click it. This will install it in your Plugins > Macros  tab. Now each time you need to use it  use Plugins > Image Expression and run it by clicking it. You will probably see how it is used just by looking at it, but if not then just type back at me and describe the situation and we will work on it, but I doubt you will have any problems.
You will have to install it every time you start ImageJ but only once. Then you can decide if you want to install it permantly.
You are correct that the expression is entered once you run it. You will see where to assign the color channels there also.
I personally use a custom LUT, but it is simply the listed "Physics" LUT inverted. If you use the standard Physics LUT, then the Red colors are the highest intensity and the Blue colors as the darkest or black pixels. Use Analyze > Histogram to see which and how many pixels are depicted. You should also probably use a copy of your processed image prior to adding the LUT to compare to until you get used to reading the Histogram, but that shouldn't take long.
It may sound complicated at first but it isn't so don't get excited or discouraged as you go, I know you can do it.
Any other questions or problems then just let me know.
Bob

________________________________
From: Emily Teng <[hidden email]>
Sent: Tuesday, October 15, 2019 6:26 PM
To: [hidden email] <[hidden email]>
Subject: Re: Totally new here. Color Counter question

Dear Bob,

Thank you so much for your suggestions.  Unfortunately, I am very ignorant on how to  use the program.  I don't know how to do most of you what you suggested.  First:

Process > Image Expression Parser(Macro).  Where is this?  Something I need to add?  I do know how to split the channels. ( Image > Color > Split Channels (make sure to keep the original)) but not how to use the parser macro to assign Red to A, Green to B, and Blue to C.


I guess the parser macro is where I am supposed to "Enter the equation in the field ,,,Sqrt(1-(A*A)/(B*B))?"

I see there are many LUTs but I don't know how to use them.

If you have the time and could give more detailed step by steps on how to do this, I would really appreciate it.  I am learning, but have literally just downloaded the program a week ago and looked at a few tutorials so really know next to nothing....

Thank you so much.

Emily

--
ImageJ mailing list: https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=02%7C01%7C%7C38c296a2c6e74bdaa05c08d751beba85%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637067751917071227&amp;sdata=j77eEzO%2BNitHCuINJ3hzFOfGgqaMynf4i90yzvcfn9g%3D&amp;reserved=0

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

Express Parser.txt (25K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Totally new here. Color Counter question

Emily Teng
In reply to this post by Emily Teng
Hi Bob,

Thank you so much!  So I've installed the Image Expression Macro.  I loaded one of the photos and split the channels then tried to run the macro, but received this error:


Error: Undefined variable in line 1:
                <import> java . awt . * ;


Does this mean I don't have the proper Java installed?  

Emily

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