Python3.X 成功解决 module 'cv2' has no attribute 'xfeatures2d'

  • 描述问题
    AttributeError: module ‘cv2’ has no attribute ‘xfeatures2d’
  • 查看opencv版本号
import cv2
print('OpenCv Version:',cv2.__version__)
  • 如果版本小于等于 OpenCv Version: 3.3.0
# 卸载原有opencv-python,直接安装 opencv-contrib-python
pip uninstall opencv-python
pip install opencv-contrib-python
  • else,opencv更高版本的contrib里面专利保护了SIFT和SURF
# 卸载原有opencv-python,建议安装 opencv-contrib-python==3.3.0.10
pip uninstall opencv-python
pip install opencv-contrib-python==3.3.0.10

你可能感兴趣的:(Python,TensorFLow)