Code to calculate the color difference using euclidean distance of an image?

4 views (last 30 days)
I want to calculate the color difference in an image which is in CIE L*a*b* color space. For that I want to utilise euclidean distance method. In this CIE L*a*b* clolor space, the color difference between two colors, ( L1*,a1*,b1* )and ( L2* a2* b2* ) is required. But I m facing problem to compute it. Help will be very much appreciated. Thanks.

Answers (2)

Walter Roberson
Walter Roberson on 31 Dec 2013
sqrt((L1-L2).^2 + (a1-a2).^2 + (b1-b2).^2)

Image Analyst
Image Analyst on 31 Dec 2013
There are a whole bunch of different flavors of delta E in this toolbox created by one of the worlds leading experts in color, Stephen Westland: http://www.mathworks.com/matlabcentral/fileexchange/40640-computational-colour-science-using-matlab-2e. That said, for most simple situations I use the simple formula Walter gave.

Community Treasure Hunt

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

Start Hunting!