color-problem with imread and image
6 次查看(过去 30 天)
显示 更早的评论
I'm working on a mirror anamorphosis by a cilindrical mirror. I'm having a problem with using colors. The problem can be reduced to this simple script:
picture = imread('pict.jpg')
image(picture)
This is the picture that I want to get:

This is the picture that I do get:

Does anyone know what went wrong? Many thanks.
5 个评论
Image Analyst
2022-5-7
@Omer Al Sumeri, sure. Just start a new thread and attach your indexed image file. There, show us a screenshot of what you're getting when you use my answer from below
[indexedImage, cmap] = imread('Charizard.jpg.png');
imshow(indexedImage, cmap);
采纳的回答
Image Analyst
2017-8-13
It's an indexed image. Get the second output of imread(), which you are not asking for now. It will be the color map. Then apply it with the colornap() function.
2 个评论
Image Analyst
2017-8-14
[indexedImage, cmap] = imread('Charizard.jpg.png');
imshow(indexedImage, cmap);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!