def intersection(x1, x2):
    """Histogram Intersection

    Parameters
    ----------
    x1: numpy.ndarray
        Vector one
    x2: numpy.ndarray
        Vector two

    Returns
    -------
    distance: float
        Histogram intersection between `x1` and `x2`
    """
    assert(len(x1) == len(x2))
    minsum = 0
    for i in range(len(x1)):
        minsum += min(x1[i], x2[i])
    return float(minsum) / min(sum(x1), sum(x2))