News for hackers. Stuff that matters.
Re:How to build a simple image and primary-colour similarity... by cordite on Friday January 02, 2015 @09:38AM (#8826840)
The first thought I had would be to put this into HSV, and then index that with an R-tree [1]. This way, you can do nearest neighbor kind of stuff, similar to geospatial indexing.

[1]: http://en.wikipedia.org/wiki/R-tree

Re:How to build a simple image and primary-colour similarity... by sibsibsib on Friday January 02, 2015 @10:07AM (#8826951)
I've had good results from converting to Lab space and geospatial indexing the ab components.

http://en.m.wikipedia.org/wiki/Lab_color_space

Re:How to build a simple image and primary-colour similarity... by 3pt14159 on Friday January 02, 2015 @06:28PM (#8829155)
You can't use HSV because the apparent differences in H / S / V aren't linear. You need to convert it to a different color system:

https://en.wikipedia.org/wiki/Munsell_color_system

What is interesting about this color system is that it isn't symmetric (your eye is better at differentiating certain hues like blue at more maximal values than others) so more care is needed on the nearest neighbour lookups.

If you are using this coloring scheme for labelling colors in a photograph then you also need to adjust for colors that are especially vibrant and overtake the photo. For example this photo:

http://1.bp.blogspot.com/-OkTS4Wo34UM/Uwg568lRl2I/AAAAAAAAFi...

Is best tagged "pink" not "brown".