1
我想比較使用compareHist()函數的兩個直方圖,但我無法設法插入正確的比較方法。在文件中的選項是Python OpenCV 3:如何使用cv2.CV_COMP_HELLINGER
CV_COMP_CORREL Correlation
CV_COMP_CHISQR Chi-Square
CV_COMP_CHISQR_ALT Alternative Chi-Square
CV_COMP_INTERSECT Intersection
CV_COMP_BHATTACHARYYA Bhattacharyya distance
CV_COMP_HELLINGER Synonym for CV_COMP_BHATTACHARYYA
CV_COMP_KL_DIV Kullback-Leibler divergence
每個都可以用cv2.cv調用。 我使用OpenCV的3.2.0和我得到的錯誤
d = cv2.compareHist(query_hist, input_hist, cv2.CV_COMP_HELLINGER)
AttributeError: 'module' object has no attribute 'CV_COMP_HELLINGER'
我曾經嘗試都cv2.cv.CV_COMP_HELLINGER和cv2.CV_COMP_HELLINGER但錯誤是一樣的
cv2.COMP_HELLINGER? – Miki
它給出同樣的錯誤。我試過了 – Argentina
它應該是cv2.HISTCMP_HELLINGER – Miki