编程报错:module 'cv2.cv2' has no attribute 'xfeatures2d'
程序员文章站
2024-03-25 10:49:22
...
module ‘cv2.cv2’ has no attribute ‘xfeatures2d’
两个原因导致:
- 缺少包contrib
- opencv版本不对
解决办法也很简单:
1、卸载原有的opencv
pip uninstall opencv-python
2、将opencv版本退到3.4.2
pip install opencv-python==3.4.2.16
3、再补上一个版本配套的contrib包
pip install opencv-contrib-python==3.4.2.16
即可。
推荐阅读
-
Module ‘cv2.cv2‘ has no attribute ‘ximgproc‘
-
报错:AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'
-
编程报错:module 'cv2.cv2' has no attribute 'xfeatures2d'
-
python编程排除163邮箱发送邮件报错(AttributeError: ‘tuple‘ object has no attribute ‘encode‘)
-
python编程排除163邮箱发送邮件报错(AttributeError: ‘tuple‘ object has no attribute ‘encode‘)
-
【Tensorflow】Linux下Tensorflow报错:AttributeError: module ‘tensorflow‘ has no attribute ‘xxxx‘
-
pycharm安装 suds模块报错:AttributeError: module 'pip' has no attribute 'main'
-
AttributeError:module‘cv2.cv2‘has no attribute ‘ TrackerCSRT_create‘
-
python报错:AttributeError: 'module' object has no attribute 'xfeatures2d'
-
python多线程下报错:AttributeError: 'module' object has no attribute '_strptime'