My Colored image gets read as a bw image
1 回表示 (過去 30 日間)
古いコメントを表示
pic=imread('C:\Users\Acer\Desktop\p.png');
imshow(pic) (this is how the image in my desktop looks)
(this how the matlab reads it)
0 件のコメント
採用された回答
Ameer Hamza
2020 年 9 月 26 日
編集済み: Ameer Hamza
2020 年 9 月 26 日
MATLAB is loading it as an indexed image: https://www.mathworks.com/help/images/image-types-in-the-toolbox.html#f14-17587. The following show how to display it properly
[im, cm] = imread('image.png', 'png');
imshow(im, 'Colormap', cm)
If you also want an rgb image
[im, cm] = imread('image.png', 'png');
im_rgb = ind2rgb(im, cm);
imshow(im_rgb)
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!