报错:Module 'cv2.cv2' has no attribute 'ximgproc'
opencv有4种包:
opencv-python
opencv-contrib-python
opencv-python-headless
opencv-contrib-python-headless
只能用一种,不然会有冲突。
如果报上面的错,则需要先卸载掉之前的opencv包:
pip uninstall opencv-contrib-python opencv-python
然后安装下面的opencv包:
pip install opencv-contrib-python