I'm looking at a Computer Vision application where I try to analyze the strength of edges a certain set of colors make with another color. For, this I take images of two colors falling on top of each other and record the edge strength (through a gradient) for a pair of colors.
Now, if I plot this edge strength graph for each color pair I get a graph like below:
In the graph each point represents an edge strength between two colors, which are represented by a string two RGB tuples.
Based on this edge strength data I'd like to cluster the colors used into a k number of clusters. The clusters should group the colors such that the color pairs with low edge strength are grouped together, and color pairs that with high edge strength end up in different clusters. For example, if white and yellow have high edge strength, I want them to be in different clusters. If white and grey have low edge strength, I want them in the same cluster. Even though the data is between color pairs, I'd like to get a result where the cluster consists of a set of colors.
I thought this was straight forward with k means clustering, but since the data for color pairs and edge strength between two pairs, I cannot understand how to pre-process the data so that I can cluster the data and get colors as per my requirement. May I know how can I solve my problem with k-means or any other method?
Thanks in advance!