Displaying gif Image in Matlab

16 ビュー (過去 30 日間)
Robert
Robert 2013 年 6 月 24 日
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 日
[I cmap] = imread('image_name.gif','frames','all');
image(I);
colormap(cmap);

Nitin
Nitin 2013 年 6 月 24 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeBlue についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by