AttributeError: module 'cv2' has no attribute 'SIFT'
来源:互联网 发布:网络棋牌开发公司 编辑:程序博客网 时间:2024/06/05 05:26
在用python使用opencv进行SIFT时候,编译出现这样问题:
Traceback (most recent call last): File "F:/PyCharm/pydir/t3.py", line 4, in <module> sift = cv2.SIFT()AttributeError: module 'cv2' has no attribute 'SIFT'
这样的错误信息。代码如下:
import cv2img = cv2.imread('test3.jpg')sift = cv2.SIFT()
原因:opencv将SIFT等算法整合到xfeatures2d集合里面了。变更后写法如下:
import cv2img = cv2.imread('test3.jpg')gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)sift = cv2.xfeatures2d.SIFT_create()kp = sift.detect(gray,None)img=cv2.drawKeypoints(gray,kp,img)cv2.imwrite('sift_keypoints.jpg',img)
附:官方文档说明
http://docs.opencv.org/master/da/df5/tutorial_py_sift_intro.html
阅读全文
0 0
- AttributeError: module 'cv2' has no attribute 'SIFT'
- AttributeError: module 'cv2.face' has no attribute 'createEigenFaceRecognizer' 解决办法
- module 'cv2' has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'
- module 'cv2' has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'
- AttributeError: 'module' object has no attribute 'getpass'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'module' object has no attribute 'randint'
- AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute 'LabelMap'
- AttributeError: 'module' object has no attribute 'XXX'
- AttributeError: 'module' object has no attribute 'urlopen'
- AttributeError:'module' object has no attribute 'classify'
- AttributeError: ‘module’ object has no attribute’xxx’
- AttributeError: ‘module’ object has no attribute’ 问题
- AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'
- AttributeError: 'module' object has no attribute 'AF_INET'
- squid代理服务器
- Nginx模块开发指南中文版
- @NotNull和@NotEmpty和@NotBlank区别
- Scala函数式编程(六)——闭包
- 一致性哈希算法
- AttributeError: module 'cv2' has no attribute 'SIFT'
- c++实现引用计数智能指针
- Qt笔记-MSVC报newline in constant(即奇数个中文汉字的问题)
- 2-1 Java动态加载类
- pip源-PyPI使用国内源
- 第一个docker测试容器(交互式)
- Win7+VS2013+OpenCV3.0.0详细配置
- 图像的卷积
- 指定CentOS7虚拟机IP