seam_carver.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:seam_carving 作者: dharness 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号