AttributeError: module 'cv2' has no attribute 'xfeatures2d'问题解决

AttributeError: module 'cv2' has no attribute 'xfeatures2d'问题解决

!pip list|grep opencv


opencv-contrib-python         4.6.0.66
opencv-python                 4.6.0.66
复制代码
img = cv.imread('/home/mw/input/opencv5111/opencv-data/fruits.jpg',0)

# Create SURF object. You can specify params here or later.
# Here I set Hessian Threshold to 400
# 就opencv4.4.0这个版本来说,SIFT方法已经可以直接使用了
# surf = cv.xfeatures2d.SURF_create(400)
surf = cv.SIFT_create(400)
复制代码

猜你喜欢

转载自juejin.im/post/7178367764791296055