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
评论列表
文章目录