I'm trying to find the distance between two vectors using openCV's compareHist() method. I'm using opencv-contrib-python 3.4.2.17. If I try to use the compareHist() method as described in the documentation here https://docs.opencv.org/3.4.2/d6/dc7/group__imgproc__hist.html#gaf4190090efa5c47cb367cf97a9a519bd I get an error "AttributeError: module 'cv2.cv2' has no attribute 'CompareHist'"
Am I calling the method incorrectly, or am I using the documentation incorrectly?
My snippet of testing code is below for reference. Thanks.
import numpy as np
import cv2 as cv
img = cv.imread('../data/im3.jpg')
img2 = cv.imread('../data/im4.jpg')
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
gray2 = cv.cvtColor(img2, cv.COLOR_BGR2GRAY)
sift = cv.xfeatures2d.SIFT_create()
kp, des1 = sift.detectAndCompute(gray,None)
kp2, des2 = sift.detectAndCompute(gray2,None)
print(cv.CompareHist(des1[0], des2[0], CV_COMP_CORREL))