Today I tried local sensitivity hashing in C. The result is very interesting. Suppose you have N feature vectors, each vector is in R^D, you want to hash them to 1<<K bytes. Local Sensitivity Hashing give you the answer in O(NDK);

It might be useful for image compression. Of course, k-means is preferred and you should always work in LAB color space instead of GBR.

The feature vectors (LAB color) are stored in M[N][D].

P.S. Just a try, I did not generate uniform sampling.