美文网首页
报错处理:AttributeError: module 'cv2

报错处理:AttributeError: module 'cv2

作者: LiBiscuit | 来源:发表于2021-09-05 16:31 被阅读0次

最近需要再次用到SIFT代码实现
(参照之前文章)https://www.jianshu.com/p/e25562a87cca
遇到了系统报错
AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'
(查了一些网站,大部分是说版本问题,就是新的opencv版本不兼容SIFT,SIFT有专利了)
于是只能卸载 安装较低版本的(按照以下命令执行即可)

pip install opencv-python==3.4.2.16
pip install opencv-contrib-python==3.4.2.16
pip install --user opencv-contrib-python==3.4.2.16

大功告成~
https://www.pianshen.com/article/69371004209/

相关文章

网友评论

      本文标题:报错处理:AttributeError: module 'cv2

      本文链接:https://www.haomeiwen.com/subject/hrbjwltx.html