Matlab Imshow command does not show the same binary image with original

I read the image with:
W=double(imread('rose32.bmp'));
Then: imshow(W,[]); or imshow(W);
But, Showed image seems to invert of original image. How Can I solve this problem ? It is a Matlab problem ?

 채택된 답변

You are treating the image as if it is a binary or RGB image, but it is not: it is an index (pseudocolor) image. You can see this by using
iminfo('rose32.bmp')
and noticing the "ColorType: 'indexed'"
A proper way to display it:
[W,cmap]=imread('rose32.bmp');
image(ind2rgb(W,cmap))

댓글 수: 4

Mevlut Dogru
Mevlut Dogru 2015년 12월 14일
편집: Mevlut Dogru 2015년 12월 14일
Below code running. But iminfo function do not working at Matlab 2010. Do you know of this reason ?
sorry, should be imfinfo()
for Gri Level image imfinfo('Lena.gif') command shows "ColorType: 'indexed'" is it true ?
If the Colormap shows up as nonempty then it is a pseudo color image not a grayscale image. .gif are mostly pseudo color.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

질문:

2015년 12월 14일

댓글:

2015년 12월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by