Ask Your Question

Revision history [back]

python opencv sift not return keypoints but return descriptors

I was using opencv with python. Contrib modules have been installed (maybe successfully). When I was running the code from official tutorial below: img = cv2.imread('home.jpg') gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) sift = cv2.xfeatures2d.SIFT_create() kp,des = sift.detectAndCompute(gray,None) img=cv2.drawKeypoints(gray,kp) cv2.imwrite('sift_keypoints.jpg',img)

sift.detectAndCompute() could work and return descriptors but it did not return any keypoints. I have tried this with python 3.6, opencv 3.3.0 and python 2.7, opencv3.1.0

I do not know what happened. I could not find answers from website. Thanks a lot.