module 'cv2.cv2' has no attribute 'xfeatures2d'

  1. 如果已经安装过OpenCV,通过 pip uninstall opencv-python 卸载
  2. 安装你想要的版本,通过语句例如: pip install opencv-contrib-python == 3.4.2.16

notes: 该过程是在annoconda中的annoconda prompt中操作的

  • 参考
  • https://blog.csdn.net/weixin_43167047/article/details/82841750
  • https://blog.csdn.net/github_38236333/article/details/78781210

你可能感兴趣的:(python)