distance icon indicating copy to clipboard operation
distance copied to clipboard

Implement Hamming distance

Open opatiny opened this issue 2 years ago • 1 comments

The Hamming distance can typically be used to compute the distance between two bit strings very easily, by doing sum(xor(a,b)). It counts the number of dissimilar elements between the strings. It can be used as a distance measurement for feature matching.

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

opatiny avatar Dec 20 '22 13:12 opatiny

Should get inspired by Tanimoto: https://github.com/mljs/distance/blob/master/src/similarities/tanimoto.js Take care than tanimoto has this flag 'bitvector' to specifiy that the a and b parameters are array (of uint32 I guess).

lpatiny avatar Dec 20 '22 13:12 lpatiny