color-problem with imread and image

6 Ansichten (letzte 30 Tage)
Merijn Vangilbergen
Merijn Vangilbergen am 13 Aug. 2017
Kommentiert: Image Analyst am 7 Mai 2022
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 Kommentare
Omer Al Sumeri
Omer Al Sumeri am 5 Mai 2022
The answer is unclear to me, Can someone clarify?
Image Analyst
Image Analyst am 7 Mai 2022
@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);

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 13 Aug. 2017
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 Kommentare
Image Analyst
Image Analyst am 14 Aug. 2017
[indexedImage, cmap] = imread('Charizard.jpg.png');
imshow(indexedImage, cmap);
Image Analyst
Image Analyst am 15 Aug. 2017
Glad this fixed it for you. If you're done, you can "Accept" the answer.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by