I need to segment the image by 7 colors (red, orange, yellow, green, light-blue, blue, violet) as in the rainbow. Do you know how to do it? Any papers or algorithms may be. For example it can be done by assigning each triple (r, g, b) a color. But it is not effective as we got there 255^3 of combinations.
Share
The “H” component of the HSV colourspace http://en.wikipedia.org/wiki/HSL_and_HSV, will give you a reasonable number representing the position on a (continuous) rainbow.
Then it is easy enough to divide that continuous space into seven segments of your choice.