comparing colour similairty of two images

7 views (last 30 days)
hi,
I have two RGB images of same size (250x250 or 100x100 depending on the program); but i need to get a value for the two images colour similairty. I have seen people saying that Delta E or Euclidean Distance for its similarity but i dont know how to get a double value for this. I basically just want to know how much of the same colours are used in image A and Image B.
Sorry if that sounds confusing. Thanks in advance

Answers (1)

Image Analyst
Image Analyst on 21 Apr 2015
I was just talking about that today. Two engineers from our manufacturing group called me in today to consult on the very same general problem (quantifying color difference), and a month ago from someone in R&D on a totally different color comparison problem. It really depends on what you want to detect. For example do you just want a single metric about how different are images that are substantially the same? Do you want to compare discolorations for two images that are not substantially the same, spatially? Do you want to detect if your component "spot colors" in your manufacturing process are no good? Do you want to detect if your image is not being printed due to dithering problems or misalignment of print heads, or a print head being clogged?
Anyway, you can use delta E, or you can compare quantized gamuts, or you can use custom algorithms like the one these people developed. It just depends on what information would be useful to you. Maybe you can post a "good" image and a "bad" one that you want to compare to the good one.
  10 Comments
Mohammed Khan
Mohammed Khan on 21 Apr 2015
Edited: Mohammed Khan on 21 Apr 2015
thanks. I fif that for two 100x100 images. how can i now nuse this to see if there is colour similarity betweent he two images(how much of the colours in the two images match). If i just substract the values, would that give me some indication. e.g. if meanRed1 - meanRed2 = 10 they are similair and if meanRed1 - meanRed2 = 200 they are not???
Im sorry if this is coing across as simple. I just havent worked with image processing before
meanRed1 = 249.3624 meanGreen1 = 198.9532 meanBlue1 = 198.9566
meanRed2 = 215.1892 meanGreen2 = 205.3406 meanBlue2 = 213.5244
Image Analyst
Image Analyst on 21 Apr 2015
You need to cast to double so you can get negative values. Then take the absolute value
deltaR = abs(double(meanRed1) - double(meanRed2));
deltaG = abs(double(meanGreen1) - double(meanGreen2));
deltaB = abs(double(meanBlue1) - double(meanBlue2));
I don't know your definition of similar. I don't know how close they need to be to be "similar". Maybe 10 is fine, maybe 20, maybe 30. That's your choice.

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!