MATLAB: How to convert the RGB color map into an HSV color map

color differencecolor spacecolormapdelta ehsv colormapImage Processing Toolbox

Hi All,
I need to do these steps :
1-Convert an RGB image to colormap say M
2-Convert this RGB colormap M to an HSV colormap say cmap
By using this conversion in MATLAB cmap = rgb2hsv (M) that converts an RGB colormap M to an HSV colormap,But my question How can I get the RGB colormap M firstly then to us it in rgb2hsv(M) function? Please could anyone explain to me in example,Thanks in advance for Help.
I'll wait your answer impatiently,

Best Answer

No that does not make any sense. You can't just apply some different colormap to an indexed image and expect it to look sensible. It will look like garbage. And calculating the variance of a colormap is meaningless. Perhaps you want the color frequency image like this calculates but I don't know.
I think perhaps you're getting color map confused with colorspace. You want to do something, though I don't know what it is. And you think that this colormap approach is the way to do it, but it's not - it's a dead end. So why don't you tell me what you really want to do and I can recommend an approach. For example you want so segment out pixels of some particular color out of an image, or you want to classify the image into 5 different color classes.