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 comentarios

Image Analyst
Image Analyst el 14 de Ag. de 2017
Not sure what your edit was, but with what I see now, my answer below still stands.
Stephen23
Stephen23 el 14 de Ag. de 2017
Merijn Vangilbergen
Merijn Vangilbergen el 15 de Ag. de 2017
OK. I get the problem now and I've found the solution. Thank you.
Omer Al Sumeri
Omer Al Sumeri el 5 de Mayo de 2022
The answer is unclear to me, Can someone clarify?
@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);

Iniciar sesión para comentar.

 Respuesta aceptada

Image Analyst
Image Analyst el 13 de Ag. de 2017

5 votos

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 comentarios

[indexedImage, cmap] = imread('Charizard.jpg.png');
imshow(indexedImage, cmap);
Image Analyst
Image Analyst el 15 de Ag. de 2017
Glad this fixed it for you. If you're done, you can "Accept" the answer.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Convert Image Type en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by