imageCompare.py 文件源码

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

项目:Nightchord 作者: theriley106 项目源码 文件源码
def compare_images(img1, img2):
    # normalize to compensate for exposure difference, this may be unnecessary
    # consider disabling it
    img1 = normalize(img1)
    img2 = normalize(img2)
    # calculate the difference and its norms
    diff = img1 - img2  # elementwise for scipy arrays
    m_norm = sum(abs(diff))  # Manhattan norm
    z_norm = norm(diff.ravel(), 0)  # Zero norm
    return (m_norm, z_norm)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号