Example #1
0
def nearest_neighbor(src, dst):
    '''
    给每个src里面的点找dst里面最近的点
    '''
    dist, indexes = NearestNeighbors(n_neighbors=1).fit(dst).kneighbors(
        src, return_distance=True)
    return dist.flatten(), indexes.flatten()