Azzera filtri
Azzera filtri

Compare Colors of 2 Images

32 visualizzazioni (ultimi 30 giorni)
rushabh Doshi
rushabh Doshi il 6 Mar 2014
Spostato: DGM il 13 Feb 2023
Hey,
So my problem is I have 2 samples Images like the ones attached and I want to compare the difference in color between them. How can I do it ? Is taking an average of all rgb values of each image and then subtracting them from one another give the right value ?
  9 Commenti
Walter Roberson
Walter Roberson il 14 Lug 2016
ardalan benam :
No, color histograms are not adequate for recognizing mis-manufactured parts.
sateesh kumar
sateesh kumar il 7 Giu 2018
Instead of RGB comparison I prefer YCbCr and HSI plane comparison for better indication of colour differed areas.

Accedi per commentare.

Risposte (3)

Iain
Iain il 6 Mar 2014
I think that if you define "colour" correctly, that you will easily figure out the right measurement.
I also think that you need to take care as the cameras may differ drastically.
  1 Commento
rushabh Doshi
rushabh Doshi il 7 Mar 2014
I would be using a scanner to have the same light conditions.
How mus I define colour correctly ? RGB comparison is the right step ?

Accedi per commentare.


Image Analyst
Image Analyst il 6 Mar 2014
You didn't attach the images. Sure, you can just take the mean RGB and compare/subtract those - that's one way. There are other ways. How you should proceed actually really depends on what kind of information you need to do what you want to do . So, unless the pictures are identical for every single pixel, there will be a difference. But how big does the difference need to be for you to take action on that knowledge? If it's only the red value of one single pixel, do you want to know that? Or will that not affect what decisions you'll make? If the images are nominally the same (same scene and field of view and the images are aligned) then you can calculate the delta E (color difference) between every single pixel. What exactly do you want to do once you know that there is a color difference? Do you want to do histogram matching?
  2 Commenti
rushabh Doshi
rushabh Doshi il 7 Mar 2014
Hey, Thank you for the reply :) Can I know how Can Delta E comparison help me solve the problem statement ? Once I know the colour difference I can know if the product produced by a machine on which I am doing comparison matches the master product. One of the physical properties the product must match is the colour. The code must tell me how far off I am from the master colour sample. How will histogram matching help me ? Can you shed some light ?
Image Analyst
Image Analyst il 7 Mar 2014
That's EXACTLY why delta E was invented. It's main purpose in life is to specify color differences, especially in industrial manufacturing situations where you have to match a new batch with a standard color. Think of all the products out there that have a particular color with them: Tide orange, Coca Cola Red, Pepto Bismol pink, etc. How do you think they maintain the same color year after year despite changes in inks, dyes, and other raw materials? They use delta E. It's a very well established method.
Go here for formulas for RGB to LAB and from LAB to delta E. http://www.easyrgb.com/index.php?X=DELT Also see the delta E app in my File Exchange http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Accedi per commentare.


David Setiabudi
David Setiabudi il 17 Mag 2016
Delta E is to compare one color to ANOTHER COLOR. Not one full colored image with it's colorful structure TO ANOTHER COLORFULL IMAGE............
We got the same problem... LOOKING FOR THE CMSSIM....
  3 Commenti
Image Analyst
Image Analyst il 17 Mag 2016
The original poster wanted to compare the color of one green part to another. In that case, getting the average CIE LAB colors of the green parts and plugging them into Delta E seems very reasonable.
Walter Roberson
Walter Roberson il 17 Mag 2016
Someone wrote an entire masters thesis about CMSSIM just a few years ago. http://ethesis.nitrkl.ac.in/5761/1/212EE1388-5.pdf

Accedi per commentare.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by