I want to find the major color (the color which appears most often) in a picture and do some analysis later.
For example, if I have this picture:
What I want to do is find out that gray, red, black, and yellow are major colors in the picture. I thought this could be done by getting a histogram with the X-axis as colors (red, blue, yellow, etc.), and the Y-axis as proportions in the image.
And once I get that histogram, I can retrieve the highest color by comparing the Y-values.
I read some examples of
ImageLevels and some other color-related functions, but I still don't know how to do this.
Any idea is welcome.