当前位置:   article > 正文

AttributeError: module ‘cv2.cv2‘ has no attribute ‘ximgproc‘解决方法_attributeerror: module 'cv2' has no attribute 'xim

attributeerror: module 'cv2' has no attribute 'ximgproc

今天在写道路中心线提取的时候,Arcgis自带的提取中心线的方法不适合复杂道路网,用了ArcScan效果也不太好,对于较宽的路无法直接识别,最终使用了Opencv的道路骨架网络提取,效果很不错。但是在一开始存在一个问题,就是

thinned = cv.ximgproc.thinning(binary)
  • 1

出错:AttributeError: module ‘cv2.cv2’ has no attribute ‘ximgproc’,出错原因也很简单,就是CV2的库冲突了,安装了多个,只需要这么操作就可以了:

pip uninstall opencv-contrib-python opencv-python
pip install opencv-contrib-python
  • 1
  • 2

总结起来就是先把其他的卸载,再安装正确的,简简单单哦。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/874624
推荐阅读
相关标签
  

闽ICP备14008679号