BFMatcher match in OpenCV throwing error
问题 I am using SURF descriptors for image matching. I am planning to match a given image to a database of images. import cv2 import numpy as np surf = cv2.xfeatures2d.SURF_create(400) img1 = cv2.imread('box.png',0) img2 = cv2.imread('box_in_scene.png',0) kp1,des1 = surf.detectAndCompute(img1,None) kp2,des2 = surf.detectAndCompute(img2,None) bf = cv2.BFMatcher(cv2.NORM_L1,crossCheck=True) #I am planning to add more descriptors bf.add(des1) bf.train() #This is my test descriptor bf.match(des2) The