How do I make MATLAB to recognize the deltaE function?
Mostra commenti meno recenti
I have two images A and B. When running the code that I am using to find colour differences between two images, it keeps telling me: "Unrecognized function or variable 'deltaE'. I tried to read about how to make this function recognized and I believe I have to convert the RGB images into lab values. Yet I keep failing to understand how to do so.
Risposte (3)
Walter Roberson
il 15 Nov 2020
1 voto
https://www.mathworks.com/help/images/ref/deltae.html
needs R2020b
Image Analyst
il 15 Nov 2020
You can use sqrt() of the lab colors. There is also an rgb2lab() function that is pretty old.
de = sqrt((L1-L2).^2 + (A1-A2).^2 + (B1-B2).^2)
See attached demos.
9 Commenti
Borys Bulka
il 15 Nov 2020
Modificato: Borys Bulka
il 15 Nov 2020
Image Analyst
il 15 Nov 2020
Yes, they are. Why didn't you use rgb2lab() like I instructed? Try this:
rgbImage1 = imread(filename1);
rgbImage2 = imread(filename1);
lab1 = rgb2lab(rgbImage1);
lab2 = rgb2lab(rgbImage2);
[L1, A1, B1] = imsplit(lab1);
[L2, A2, B2] = imsplit(lab2);
de = sqrt((L1-L2).^2 + (A1-A2).^2 + (B1-B2).^2); % An image
imshow(de, []);
The demos are standalone demos that illustrate various ways to use Delta E color difference. You may modify them as you wish, and incorporate them into your own code if you wish.
Borys Bulka
il 15 Nov 2020
Image Analyst
il 15 Nov 2020
Why didn't it work? If you don't have imsplit(), you can do it like you did. Otherwise post your code as you have it now, along with your two images.
Borys Bulka
il 15 Nov 2020
Modificato: Borys Bulka
il 15 Nov 2020
Image Analyst
il 15 Nov 2020
Can you attach your A and B images if you want me to try that code?
Borys Bulka
il 15 Nov 2020
Image Analyst
il 16 Nov 2020
I think the best book is "The Image Processing Handbook" by John Russ.
Another free online book is by RIchard Szeliski:
Borys Bulka
il 16 Nov 2020
Ameer Hamza
il 15 Nov 2020
deltaE() function is available in Image processing toolbox. This error message indicates that, most likely, you don't have that toolbox installed. You can run the following line in the command window
ver images
and if you get a warning, it means that you don't have the toolbox installed.
7 Commenti
Borys Bulka
il 15 Nov 2020
Ameer Hamza
il 15 Nov 2020
Can you paste the complete error message?
Borys Bulka
il 15 Nov 2020
Modificato: Borys Bulka
il 15 Nov 2020
Ameer Hamza
il 15 Nov 2020
Can you show the output of
which deltaE
Borys Bulka
il 15 Nov 2020
Modificato: Borys Bulka
il 15 Nov 2020
Ameer Hamza
il 15 Nov 2020
Can you attach the image A.png?
Borys Bulka
il 15 Nov 2020
Categorie
Scopri di più su Color in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!