Displaying gif Image in Matlab

I have a .gif image in my directory. When I open it there is a variable 'cdata' with the pixel data and a variable 'colormap' with the colour map.
I want to display the image, but when I type
image(cdata)
The colours are wrong. I tried setting the colormap using
colormap('colormap')
But this still didn't work.

답변 (2개)

Leah
Leah 2013년 6월 24일

2 개 추천

[I cmap] = imread('image_name.gif','frames','all');
image(I);
colormap(cmap);
Nitin
Nitin 2013년 6월 24일

1 개 추천

I = imread('image_name.gif');
imshow(I)

댓글 수: 1

Robert
Robert 2013년 6월 24일
When I do this the displayed image is black and white. I can see the correct image in the Matlab preview of the photo, so it must be something to do with the colormap.

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

카테고리

도움말 센터 및 File Exchange에서 Blue에 대해 자세히 알아보기

질문:

2013년 6월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by