"""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.

The enrollement and scoring functions of this class are implemented by its

base :py:class:`bob.bio.base.algorithm.Distance`.

**Parameters:**

The input to this function should be of binary nature (boolean arrays). Each

binary input is first flattened to form a one-dimensional vector. The `Hamming

distance <https://en.wikipedia.org/wiki/Hamming_distance>`_ is then

calculated between these two binary vectors.

``distance_function`` : function

Set this parameter to ``scipy.spatial.distance.hamming`` to ensure we are calculating the Hamming distance

The current implementation uses :py:func:`scipy.spatial.distance.hamming`,

which returns a scalar 64-bit ``float`` to represent the proportion of

mismatching corresponding bits between the two binary vectors.

``is_distance_function`` : bool

Set this flag to ``False`` to ensure that Hamming distances are returned as positive values rather than negative

The base clas constructor parameter ``is_distance_function`` is set to

``False`` on purpose to ensure that calculated distances are returned as

positive values rather than negative.

"""

def__init__(

self,

distance_function=scipy.spatial.distance.hamming,

is_distance_function=False# setting this to False ensures that Hamming distances are returned as positive values rather than negative