My Colored image gets read as a bw image
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Altina Rexha
el 26 de Sept. de 2020
Comentada: Ameer Hamza
el 26 de Sept. de 2020
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 comentarios
Respuesta aceptada
Ameer Hamza
el 26 de Sept. de 2020
Editada: Ameer Hamza
el 26 de Sept. de 2020
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!