Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to execute sift() in python 3.6

I m trying this bit of code. But always error for cv2.SIFT(). I m using python 3.6, windows 64 bit. I tried installing opencv contrib using anaconda prompt.

import cv2 import numpy as np

img = cv2.imread('home.jpg') gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

sift = cv2.SIFT() kp = sift.detect(gray,None)

img=cv2.drawKeypoints(gray,kp)

cv2.imwrite('sift_keypoints.jpg',img)