I'd like to read an image in matlab and convert it to an indexed image
Here is my code:
[I map] = imread('image.tif');
I = rgb2ind(I, map);
figure(1);
imagesc(I);axis('equal');
When I just read the image, it looks fine (but it is an rgb image). Then I convert it to an indexed image, I have the following picture:
What is wrong with this piece of code?