distanceMetrics.py 文件源码

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

项目:TikZ 作者: ellisk42 项目源码 文件源码
def analyzeAsymmetric(a,b):
    # a = target
    # b = current
    # if you see a pixel in current that isn't in target, that's really bad
    # if you see a pixel and target that isn't an current, that's not so bad
    import cv2
    kernelSize = blurKernelSize


    a = cv2.GaussianBlur(a,(kernelSize,kernelSize),sigmaX = 0)
    b = cv2.GaussianBlur(b,(kernelSize,kernelSize),sigmaX = 0)

    showImage(a + b)

    d = a - b
    targetBigger = np.sum(d[d > 0]*d[d > 0])
    currentBigger = np.sum(d[d < 0]*d[d < 0])
    print "targetBigger = %f"%targetBigger
    print "currentBigger = %f"%currentBigger

#    showImage(b)

    return currentBigger*2 + targetBigger
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号