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.
Best Answer