Could someone explain what 'map' means in the following
matlab code :
I = imread('cat.jpg');
[X,map] = rgb2ind(I,256);
I can understand the relationship between X and map.
X(1,1) = 12, for instance says the color of the 1st pixel
in image is the colour represented in row 12 of 'map'
matrix.
What I dont understand is the way the colour is
represented in each row of the 'map' matrix. For example :
if
12 0.0039216 0.011765 0.0039216
is a particular colour in row 12 of 'map', then what does
the decimal value in each column mean and how is it
derived?
Please let me know this at the earliest as I need to
understand this in order to continue with my final year
project.
Many thanks,
Jeevashini
That's the colormap generated by the RGB2IND function for your new indexed
image X.
> I can understand the relationship between X and map.
> X(1,1) = 12, for instance says the color of the 1st pixel
> in image is the colour represented in row 12 of 'map'
> matrix.
>
> What I dont understand is the way the colour is
> represented in each row of the 'map' matrix. For example :
>
> if
>
> 12 0.0039216 0.011765 0.0039216
>
> is a particular colour in row 12 of 'map', then what does
> the decimal value in each column mean and how is it
> derived?
It's an RGB vector. You should read through these documents; they describe
colormaps, RGB vectors, and indexed images and how these things interact.
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/colormap.html
http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f5-41276.html
http://blogs.mathworks.com/steve/2006/02/03/all-about-pixel-colors-part-2/
--
Steve Lord
sl...@mathworks.com