def intersectiondist(x,y):
    """Returns the histogram intersection distance between two vectors.
    This is the sum of ``min(a,b)`` for each element.
    This is usually the most effective distance measure when comparing histograms,
    such as SIFT vectors in computer vision.
    """
    return sum(min(a,b) for a,b in zip(x,y))