True color detection from taken picture

5 views (last 30 days)
DS on 22 Nov 2022
Commented: John D'Errico on 29 Nov 2022
Hello I have a problem with a project, I am writing here the exact task for it:
True color detection
The red color in the ring has real RGB values: 255 , 0 , 0 . In hexadecimal form: ff0000 . The goal of the assignment is to program a program that will be able to recognize the true RGB values of the colors of the swatch. All RGB color values are shifted because the swatch was taken with a phone which distorts. I need to find out the color and then shift it by the necessary RGB values. (note: it is not allowed to use graphic programs, e.g.: Photoshop, gimp, etc. for the final realization).
I have tried it with a code which I will add here, but it only works when I load the original picture too. I need to rework without the need of the original picture,it must detect the real color from a taken picture and shift back the color value to the original picture. I hope it is understandable and someone can help me with this, I need this ASAP, thank you.
PS: You need to open both .m files (project and readPoints), but run only the project file, it opens the photo.jpg and a coursor appears, you need to click on a random color, then a point appears where you clicked, the results will appear in the the command line, everything else is explained in the scripts.

Answers (2)

Image Analyst
Image Analyst on 22 Nov 2022
This is a lot of work. Basically there is no "true" RGB values for the chips. The best you can do is to assume the "true" colors for the chips is the sRGB values given in the mnaufacturer's specification sheet. So then you can measure the actual RGB values of all the chips, and compare them to the sRGB values and develop a transform to change the bad/test values into estimated sRGB values. I go over this in my attached seminar.
See my Image Processing Tutorial in my File Exchange if you want code to get the sRGB values and create a chart with the sRGB values:
I also have attached a class that helps do some of the color correction stuff and color calibration stuff. Color correction (RGB-to-RGB) is different than color calibration (RGB to CIE LAB).
John D'Errico
John D'Errico on 29 Nov 2022
Very much the same when I was working on color management problems at EKRL, and on the Colorsense program. Of course there are also degree granting programs (RIT, for example.)

Sign in to comment.

Image Analyst
Image Analyst on 23 Nov 2022
Attached is a demo to take a "test" (bad) image of a color checker chart and correct it such that the chip values are much closer to the standard, published sRGB values that come from the manufacturer's specification sheet that comes with the chart. This color correction (not calibration) is a transform of a bad chart (upper left) using an RGB-to-RGB transform to a corrected/fixed/repaired image (lower left) that has chips that are now closer to the standard sRGB values (upper right) than the original image.
Of course I just corrected the chart image but once you have the transform you can now use it to transform ANY color image as long as it was taken under the same conditions as your chart image.
Image Analyst
Image Analyst on 25 Nov 2022
No I will not. I'm shocked that you would even ask. The seminar is very generic and I've posted it many times before. I did not have a generic demo for it yet but I created one just for you. Mainly because I thought it would also be a good demo to have for the future because color correction is something that comes up occasionally. I will not and would not deprive anyone else, even your classmates, of this useful demo, and the other useful code I uploaded, just because you found it useful in your particular project. That would not be fair to them or me. What we can try to do though is to make sure we never answer anything from you ever again so that there will be no record of it. This particular thread though will remain since it has none of your code in it and there is nothing proprietary or secret about it.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!