MATLAB: Compare color of images

color comparisoncolor spacedelta eImage Processing Toolboxlab color space

I have two standard shades of green.
I also have a test image ( a leaf with black background).
Can you show me how to compare the test image with the 2 standard images and determine where the test image falls closer, in terms of color, among the 2 standard images.
thank you.

Best Answer

I know we've talked about this before, a few months ago or so. First segment out the green leaf - get a binary image that is true where the leaf is and false where the leaf isn't. For example use the green mask like Walter showed you. Then the most widely used method in the color industry is to calculate the "Delta E" (which is the color difference). You convert RGB into LAB and then calculate the Euclidean distance between the two points in LAB color space. At least that's the simplest which is probably okay for you. Remember we talked about using a color checker passport to calibrate your images. Otherwise you're just using "book formulas" - which might be okay if you just want to find out which standard is closest. But if you ever want to graduate to a fully calibrated system, you'll have to use a standard such as the Color Checker Passport or the Munsell soil chart or the X-rite Color checker.