gaussian_functions.py
def generate_gaussian_kernels(round_decimals=3, sigma_threshold=4, sigma_min=0,
                              sigma_max=20, num_sigmas=801):
    """
    Computing gaussian filter kernel for sigmas in linspace(sigma_min,
    sigma_max, num_sigmas) and saving them to a dictionary. The key-value pair
    is sigma:kernel.
    """

    kernels_dict = dict()
    sigma_space = np.linspace(sigma_min, sigma_max, num_sigmas)
    for sigma in sigma_space:
        sigma = np.round(sigma, decimals=round_decimals)
        kernel_size = (np.ceil(sigma * sigma_threshold).astype(int) * 2) + 1

        img_shape  = (kernel_size, kernel_size)
        img_center = (img_shape[0] // 2, img_shape[1] // 2)

        arr = np.zeros(img_shape)
        arr[img_center] = 1

        arr = gaussian_filter(arr, sigma, mode='constant')
        kernel = arr / arr.sum()
        kernels_dict[sigma] = kernel

    return SortedDict(kernels_dict)

    Computing gaussian filter kernel for sigmas in linspace(sigma_min,
    sigma_max, num_sigmas) and saving them to a dictionary. The key-value pair
    is sigma:kernel.
    
Computing gaussian filter kernel for sigmas in linspace(sigma_min,
sigma_max, num_sigmas) and saving them to a dictionary. The key-value pair
is sigma:kernel.
Computing gaussian filter kernel for sigmas in linspace ( sigma_min sigma_max num_sigmas ) and saving them to a dictionary . The key - value pair is sigma : kernel .
def generate_gaussian_kernels(round_decimals=3, sigma_threshold=4, sigma_min=0,
                              sigma_max=20, num_sigmas=801):
    kernels_dict = dict()
    sigma_space = np.linspace(sigma_min, sigma_max, num_sigmas)
    for sigma in sigma_space:
        sigma = np.round(sigma, decimals=round_decimals)
        kernel_size = (np.ceil(sigma * sigma_threshold).astype(int) * 2) + 1
        img_shape  = (kernel_size, kernel_size)
        img_center = (img_shape[0] // 2, img_shape[1] // 2)
        arr = np.zeros(img_shape)
        arr[img_center] = 1
        arr = gaussian_filter(arr, sigma, mode='constant')
        kernel = arr / arr.sum()
        kernels_dict[sigma] = kernel
    return SortedDict(kernels_dict)
def generate_gaussian_kernels ( round_decimals = 3 , sigma_threshold = 4 , sigma_min = 0 , sigma_max = 20 , num_sigmas = 801 ) : kernels_dict = dict ( ) sigma_space = np . linspace ( sigma_min , sigma_max , num_sigmas ) for sigma in sigma_space : sigma = np . round ( sigma , decimals = round_decimals ) kernel_size = ( np . ceil ( sigma * sigma_threshold ) . astype ( int ) * 2 ) + 1 img_shape = ( kernel_size , kernel_size ) img_center = ( img_shape [ 0 ] // 2 , img_shape [ 1 ] // 2 ) arr = np . zeros ( img_shape ) arr [ img_center ] = 1 arr = gaussian_filter ( arr , sigma , mode = 'constant' ) kernel = arr / arr . sum ( ) kernels_dict [ sigma ] = kernel return SortedDict ( kernels_dict )
Computing gaussian filter kernel for sigmas in linspace(sigma_min,
sigma_max, num_sigmas) and saving them to a dictionary.
Computing gaussian filter kernel for sigmas in linspace ( sigma_min sigma_max num_sigmas ) and saving them to a dictionary .
"""
    Computing gaussian filter kernel for sigmas in linspace(sigma_min,
    sigma_max, num_sigmas) and saving them to a dictionary. The key-value pair
    is sigma:kernel.
    """
round_decimals
sigma_threshold
sigma_min
sigma_max
num_sigmas