color-problem with imread and image

조회 수: 8 (최근 30일)
Merijn Vangilbergen
Merijn Vangilbergen 2017년 8월 13일
댓글: Image Analyst 2022년 5월 7일
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
Omer Al Sumeri
Omer Al Sumeri 2022년 5월 5일
The answer is unclear to me, Can someone clarify?
Image Analyst
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
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
Image Analyst 2017년 8월 14일
[indexedImage, cmap] = imread('Charizard.jpg.png');
imshow(indexedImage, cmap);
Image Analyst
Image Analyst 2017년 8월 15일
Glad this fixed it for you. If you're done, you can "Accept" the answer.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by