img = cv2.imread('mandrill.png')
histg = cv2.calcHist([img],[0],None,[256],[0,256])
if len (sys.argv) < 2:
print >>sys.stderr, "Usage:", sys.argv[0], "<image>..."
sys.exit (1)
for fn in sys.argv[1:]:
im = cv2.imread (fn)
histr = cv2.calcHist([im],[0],None,[256],[0,256])
a = cv2.compareHist(histr,histg,cv2.cv.CV_COMP_CORREL)
print a
我正在尝试使用上面的代码来比较直方图之间的相关性histr
and histg
当我运行代码时出现错误
'module' object has no attribute 'cv'
看来CV3各个相关函数的名称都变了。各种相关函数的名称是什么?