使用cv2是报错:
AttributeError: module 'cv2.cv2' has no attribute 'bgsegm'
报错原因:使用的python环境中没有安装扩展包contrib
可以通过pip或者conda安装
pip install opencv-contrib-python
注意:contrib的版本需要和opencv版本一致,先安装opencv再安装contrib
使用cv2是报错:
AttributeError: module 'cv2.cv2' has no attribute 'bgsegm'
报错原因:使用的python环境中没有安装扩展包contrib
可以通过pip或者conda安装
pip install opencv-contrib-python
注意:contrib的版本需要和opencv版本一致,先安装opencv再安装contrib