Convert color to value
Ältere Kommentare anzeigen
Hello everyone. I have a jpg image with blue to red color corresponding to different value. There is also a colorbar showing each colorscale correspond to a value. Is there a simple way to convert this color image into matrix? Thanks a lot.
Akzeptierte Antwort
Weitere Antworten (2)
Image Analyst
am 30 Nov. 2017
1 Stimme
See my attached demo where I used the colormap in a thermal image to convert that into a grayscale temperature image.
Stephen23
am 30 Nov. 2017
0 Stimmen
2 Kommentare
Jos (10584)
am 30 Nov. 2017
+1 Hopefully it is indeed that simple ...
Image Analyst
am 30 Nov. 2017
That's the gist of it, but it's not that simple unless you already have the colormap. In many cases, the user does not and has only some kind of screenshot. My solution also uses rgb2ind() but also does the hard part of figuring out how to obtain the colormap.
Kategorien
Mehr zu Color and Styling finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!