Convert color to value
古いコメントを表示
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.
採用された回答
その他の回答 (2 件)
Image Analyst
2017 年 11 月 30 日
1 投票
See my attached demo where I used the colormap in a thermal image to convert that into a grayscale temperature image.
Stephen23
2017 年 11 月 30 日
0 投票
2 件のコメント
Jos (10584)
2017 年 11 月 30 日
+1 Hopefully it is indeed that simple ...
Image Analyst
2017 年 11 月 30 日
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.
カテゴリ
ヘルプ センター および File Exchange で Color and Styling についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!