def compute_eng_grad(img):
"""
Computes the energy of an image using gradient magnitude
Args:
img4 (n,m,4 numpy matrix): RGB image with additional mask layer.
rgb_weights (n,m numpy matrix): img-specific weights for RBG values
Returns:
n,m numpy matrix: Gradient energy map of the provided image
"""
bw_img = rgb_to_gray(img)
eng = generic_gradient_magnitude(bw_img, sobel)
eng = gaussian_gradient_magnitude(bw_img, 1)
return normalize(eng)
评论列表
文章目录