If you look at the documentation
You should declare SIFT
as:
sift = cv.SIFT_create()
Therefore the correct code will be:
sift = cv.SIFT_create()
kp, des = sift.detectAndCompute(gray,None)
Update
If you have already calculated the key-points (kp
) then draw it on the current image:
img=cv.drawKeypoints(gray,kp,img)
cv.imwrite('sift_keypoints.jpg',img)
CLICK HERE to find out more related problems solutions.