Abdulkadir Arslan
Abdulkadir Arslan

Reputation: 87

Unable to display rgb image in matlab

I wanted to display rgb image on matlab.

image= imread('seker.bmp');
imshow(image);

I wrote this lines but it is not working. Why?

Upvotes: 1

Views: 184

Answers (2)

Automne von Einzbern
Automne von Einzbern

Reputation: 91

According to the MatLAB documentation, you can use Image(var)

If you want to use imshow, you should assign an index and a matrice of color.

https://www.mathworks.com/help/matlab/ref/imread.html

Upvotes: 1

Ander Biguri
Ander Biguri

Reputation: 35525

It is plausible that you have an "indexed image", as sometimes bmp's are stored as. These instead of color values, store an index from 1 to max(colors) and then a colormap for the colors themselves.

Try:

[im,map]= imread('seker.bmp');
imshow(im,map);

Upvotes: 2

Related Questions