Ask Your Question
0

I want to use SIFT algorithm for feature detection.

asked 2017-09-22 13:53:41 -0600

biplob gravatar image

updated 2017-09-22 14:02:59 -0600

I want to use SIFT algorithm for feature detection on windows 10,but when i write cv2.SIFT().It gets wrong.Message "module has no attribute 'SIFT()' ". So how can i use it?

edit retag flag offensive close merge delete

Comments

opencv version ? (api changed in ocv3)

berak gravatar imageberak ( 2017-09-23 01:05:28 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
-2

answered 2017-09-22 20:43:36 -0600

supra56 gravatar image

Try this for python 3:

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)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-09-22 13:53:41 -0600

Seen: 202 times

Last updated: Sep 22 '17