Hacker News new | ask | show | jobs
by skeoh 3338 days ago
Does this use K-means clustering? It seems to be pretty quick!

https://en.wikipedia.org/wiki/K-means_clustering

2 comments

It is technically k-means, seeing as there are always k=6 or a user specified number of colors reported regardless of the input picture. What k-means algorithm they are using though is uncertain. Could be some form of quantization, or a lloyd type k-means. Could also be hierarchical agglomerative or many-many others. What would be interesting to try out would be some non-parametric clustering algorithms like the image recognition staples mean-shift and dbscan.
Oh wow, I've never heard of that. (EDIT: I knew what color quantization was but not the algoritm) I, too, want to know the implementation details, as I haven't been that impressed with open source libraries to detect distinct colors. Not that they don't do a decent job, but they seem to fall short of the distinct colors the human eye and brain pick up vs what might be mathematically correct.