Пример #1
0
def pixel_func(img, kernel):
    mid = get_middle(kernel)
    weight = GeneratePixelGauss(img, mid)
    # need to normalize and apply cross correlation
    weight_norm = custom_utils.norml_mtx(weight)
    apply_weights = custom_utils.sum_cross_mtx(img, weight_norm)
    return apply_weights
Пример #2
0
def combo_func(img, kernel):
    mid = get_middle(kernel)
    # generate pixel gaussian
    pixel = GeneratePixelGauss(img, mid)
    # combine with distance gaussian
    dist = np.array(BLUR33).astype(np.float)
    weight = pixel * dist
    # apply the new window
    weight_norm = custom_utils.norml_mtx(weight)
    apply_weights = custom_utils.sum_cross_mtx(img, weight_norm)
    return apply_weights