Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SIFT detection with opencv+python

When I use opencv to sift detection, program always wrong. It show: module 'cv2.cv2' has no attribute 'xfeatures2d'. I had download same version of opencv-python and opencv-contrib-python(3.3.0.10), but don't work. This is part of code:

import cv2 import numpy as np import sys imgpath=r'D:\Users\Mr.Gao\Desktop\NewFile\computer vision\varese.jpg' img=cv2.imread(imgpath) gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) sift=cv2.xfeatures2d.SIFT_create()

I use python 3.5, opencv 3.X

SIFT detection with opencv+python

When I use opencv to sift detection, program always wrong. It show: module 'cv2.cv2' has no attribute 'xfeatures2d'. I had download same version of opencv-python and opencv-contrib-python(3.3.0.10), but don't work. This is part of code:

import cv2
import numpy as np
import sys
imgpath=r'D:\Users\Mr.Gao\Desktop\NewFile\computer vision\varese.jpg'
img=cv2.imread(imgpath)
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
sift=cv2.xfeatures2d.SIFT_create()

sift=cv2.xfeatures2d.SIFT_create()

I use python 3.5, opencv 3.X