gaussian_functions.py
def compute_distances(points_dct, n_neighbors = 4, leafsize=1024):
    """
    Approximates the nearest 3 neighbours to each tree
    """
    distances_dct = dict()

    for full_img_path, points in points_dct.items():
        # build kdtree
        tree = scipy.spatial.KDTree(points.copy(), leafsize=leafsize)

        # query kdtree
        distances, _ = tree.query(points, k=n_neighbors)

        distances_dct[full_img_path] = distances

    return distances_dct

    Approximates the nearest 3 neighbours to each tree
    
Approximates the nearest 3 neighbours to each tree
Approximates the nearest 3 neighbours to each tree
def compute_distances(points_dct, n_neighbors = 4, leafsize=1024):
    distances_dct = dict()
    for full_img_path, points in points_dct.items():
        tree = scipy.spatial.KDTree(points.copy(), leafsize=leafsize)
        distances, _ = tree.query(points, k=n_neighbors)
        distances_dct[full_img_path] = distances
    return distances_dct
def compute_distances ( points_dct , n_neighbors = 4 , leafsize = 1024 ) : distances_dct = dict ( ) for full_img_path , points in points_dct . items ( ) : tree = scipy . spatial . KDTree ( points . copy ( ) , leafsize = leafsize ) distances , _ = tree . query ( points , k = n_neighbors ) distances_dct [ full_img_path ] = distances return distances_dct
Approximates the nearest 3 neighbours to each tree
Approximates the nearest 3 neighbours to each tree
"""
    Approximates the nearest 3 neighbours to each tree
    """ # build kdtree # query kdtree
points_dct
n_neighbors
leafsize