Package pyvision :: Package other :: Module distance
[hide private]
[frames] | no frames]

Module distance

source code

Functions [hide private]
 
boolToUbyte(x)
Convert a boolean vector to a ubyte vector which is much more space efficient.
source code
 
ubyteToBool(x)
Convert a byte vector to a bool vector.
source code
 
hamming(a, b) source code
 
l1(a, b)
Compute the l1 distance measure
source code
 
l2(a, b)
compute the l2 distance
source code
 
correlation(a, b)
Compute the correlation of two vectors
source code
Variables [hide private]
  hamming_table = array([0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, ...
  __package__ = 'pyvision.other'
  bits = 8
  i = 255
Variables Details [hide private]

hamming_table

Value:
array([0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, \
3, 3,
       4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, \
3, 4,
       4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, \
3, 2,
       3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, \
4, 5,
...