Commit ba79af1b by Vedrana KRIVOKUCA

Improve documentation in HammingDistance class

parent 24bc6182
Pipeline #13260 passed with stages
in 24 minutes 22 seconds
......@@ -7,9 +7,22 @@ import scipy.spatial.distance
class HammingDistance (Distance):
"""Finger vein matching: Hamming Distance between binary fingervein feature vectors
"""This class calculates the Hamming distance between two binary images.
Each binary image is first flattened by concatenating its rows to form a one-dimensional vector. The Hamming distance is then calculated between the two binary vectors.
The Hamming distance is computed using :py:func:`scipy.spatial.distance.hamming`, which returns a scalar ``float`` to represent the proportion of mismatching corresponding bits between the two binary vectors.
``distance_function`` : function
Set this parameter to ``scipy.spatial.distance.hamming`` to ensure we are calculating the Hamming distance
``is_distance_function`` : bool
Set this flag to ``False`` to ensure that Hamming distances are returned as positive values rather than negative
def __init__(
distance_function = scipy.spatial.distance.hamming,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment