image_utils.py 文件源码

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

项目:pybot 作者: spillai 项目源码 文件源码
def blur_measure(im): 
    """ See cv::videostab::calcBlurriness """

    H, W = im.shape[:2]
    gx = cv2.Sobel(im, cv2.CV_32F, 1, 0)
    gy = cv2.Sobel(im, cv2.CV_32F, 0, 1)
    norm_gx, norm_gy = cv2.norm(gx), cv2.norm(gy)
    return 1.0 / ((norm_gx ** 2 + norm_gy ** 2) / (H * W + 1e-6))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号