Comparing leaf color to a standard shades of green

I just want to ask for a help on how am I going to do this project. What I'm trying to do is take a pic of a leaf and then compare its color with a standard chart. The char that I'll be using is this:
Here are my questions:
1. What method should I use in comparing the captured image with this standard one? Should I get the histogram of each shades of green in the chart and then compare it with the histogram of the captured image?
2. If my captured picture looks like in the picture below, what method should I use so that it only process the leaf? I mean, as you can see the image, the only leaf that I'm interested is the one in the middle. What should I do to remove those images that I'm not interested with?
Thank you for the help. :)

 Accepted Answer

You need to calculate the Delta E, which is the color difference. See my Delta E demo in my File Exchange. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
To find the leaf, you will have to outline it with imfreehand() or roipolyold(). There is no way of knowing which leaf in the picture you want to examine the color of.
Of course you will have to hold your sample in the field of view so that it will have the same lighting (color and intensity) as the leaf, because as you know, you can get almost whatever RGB values you want out of your camera if you have different exposure levels, color of lighting, etc.

7 Comments

First of all, thank you for your help sir. Regarding your reply, i just have some questions. 1. Will getting the histogram of the G component be enough? Or it is still better to calculate the DeltaE? 2. Are imfreehand() and roipolyold() functions manual? I mean, is there any method that will do it automatically?
I have also an idea, do you think it would be better to put a black background (like an illustration board) behind the target leaf?
Sorry for asking too much. I hope you could help us with our project. Thank you very much and God bless.
If you can place the standard chart behind your blade of grass, that would help, or place a black card with the chart on it behind the blade. If you do that and just want to find the chip that is closest in color, then you can stay in RGB space and not use delta E but you won't have calibrated results. You can only identify the closest chip but not accurately quantify the difference because RGB values are not calibrated.
I see. Thanks for the info sir. How about cropping the 6 sections/chips of the color chart and saving their histograms, and that 6 histograms will serve as the standards? Is correlating the histogram of the leaf would be enough to compare it with the standards?
It's only valid if the chart is snapped at the same time and place as the grass image of course. If you just snap a picture of the chart in your lab, and go out to the field, the chart and the grass will have different light levels and lighting colors.
If I were you I'd use makecform() to convert the RGb into lab and then use the formula for delta E
deltaE = sqrt(deltaL^2 + deltaA^2 + deltaB^2);
to get the deltaE. Even though it's only the book formula and not actually calibrated it's better than nothing. Delta E is the industry standard for color difference and you should use it, just be sure to warn everyone you're not calibrated to a spectrophotometer and are just using book formulas.
So get the lab for each of the green patches on the chart, and the lab of the grass blade region, and see which is closest.
deltaL = L - Lgrass; % Between chart and grass for all 6 L's. L is an array of 6.
deltaA = A - Agrass; % Between chart and grass for all 6 A's.
deltaB = B - Bgrass; % Between chart and grass for all 6 B's.
deltaEs = sqrt(deltaL.^2 + deltaA.^2 + deltaB.^2);
[sortedDeltaEs, sortIndexes] = sort(deltaEs, 'ascend');
% Get the color chip it most closely matches.
closestChartIndex = sortIndexes(1);
Actually, the color chart is already the standard used by IRRI (International Rice Research Institute). I'm trying to contact them and asking for a soft copy of the different shades of green that they used in making the LCC (leaf color chart) but they are not responding. If they could just send to us the soft copy, that would be a very big help.
I'll study first about the lab space and the DeltaE for me to fully understand how it works. Thank you very much for the help sir :) I'll just ask again whenever I have a problem. I hope you won't mind me asking too much questions.
Thank you and God bless :)
What is a soft copy? You still need to have a hard copy physical chart in the field of view.
By soft copy, I mean the one they used in making the LCC in computer before manufacturing it.

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Asked:

on 5 Nov 2013

Commented:

on 12 Nov 2013

Community Treasure Hunt

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

Start Hunting!