I want to know the dominant colors present in the image below. I know a algorithm in openCV
named k-mean algorithm
but one should know the k
before hand so I want to know how to find that k
and exact RGB value of colors that are dominant and not the mean of those.
Lets take a example :
In above image :
k
is 2
how to find that out and also how to find out Exact RGB value of pink
(used on left most side) and blue
(used on right most side) used in this (not the mean of their shades)
NOTE : Images will contain specific number of colors say 5 or 6 or 7 or 2 just like pictures designed by professionals. If there is a gradient present I want the RGB value of the extreme and not the mean of those colors.
EDIT 1 : The pink on the left turns to blue on the right so basically I want to find out from which color to which color is a gradient going.