当 mac遇到module ‘cv2‘ has no attribute ‘bgsegm‘

当 mac遇到module ‘cv2‘ has no attribute ‘bgsegm‘,第1张

使用bgsegm一直报错,可以通过安装pip install opencv-contrib-python来解决问题报错
当依旧存在报错的情况时

检查python版本,若为python3版本应将代码改为

bgsubmog = cv2.createBackgroundSubtractorMOG2() #For python3

而不是

cv2.bgsegm.createBackgroundSubtractorMOG()

问题就可以解决了

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/873692.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存