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)

采纳的回答

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)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by