My Colored image gets read as a bw image

1 回表示 (過去 30 日間)
Altina Rexha
Altina Rexha 2020 年 9 月 26 日
コメント済み: Ameer Hamza 2020 年 9 月 26 日
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)

採用された回答

Ameer Hamza
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 件のコメント
Altina Rexha
Altina Rexha 2020 年 9 月 26 日
thank you sm it works
Ameer Hamza
Ameer Hamza 2020 年 9 月 26 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by