Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
**Experimental function**.

Calculate hamming dissimilarity measure between two sets of
vectors.

Parameters
----------
array1 : (P1, D) array
    P1 vectors of size D.
array2 : (P2, D) array(more...)

        def pairwise_hamming_distance(array1, array2):
    """**Experimental function**.

    Calculate hamming dissimilarity measure between two sets of
    vectors.

    Parameters
    ----------
    array1 : (P1, D) array
        P1 vectors of size D.
    array2 : (P2, D) array
        P2 vectors of size D.

    Returns
    -------
    distance : (P1, P2) array of dtype float
        2D ndarray with value at an index (i, j) representing the hamming
        distance in the range [0, 1] between ith vector in array1 and jth
        vector in array2.

    """
    distance = (array1[:, None] != array2[None]).mean(axis=2)
    return distance
        


src/s/c/scikit-image-0.9.3/skimage/feature/_brief.py   scikit-image(Download)
import numpy as np
from scipy.ndimage.filters import gaussian_filter
 
from ..util import img_as_float
from .util import _mask_border_keypoints, pairwise_hamming_distance
 
    # Get hamming distances between keeypoints1 and keypoints2
    distance = pairwise_hamming_distance(descriptors1, descriptors2)
 
    temp = distance > threshold