I tried to gets the prominent color of an image using this example. This is working perfect for plain images. But when I'm giving an image like this,
It's give me the color RGB(0,4,7)
(a black one). How may I fix this?
I tried to gets the prominent color of an image using this example. This is working perfect for plain images. But when I'm giving an image like this,
It's give me the color RGB(0,4,7)
(a black one). How may I fix this?
In fact you are not looking for the dominant color, but more for the dominant range of color. So you are looking for the bigger cluster in the RGB histogram. Take a look to the papers of Arnaud LeTrotter (at this time he was working at the LSIS laboratory in Marseille, France), it's exactly what he did. He added some tolerance to the main color detection in order to have the main range.