Traceback (most recent call last): File "C:/PycharmProjects11/day5 ����/3 GMG��Ҷ˹�ָ�.py", line 9, in <module> fgbg = cv2.createBackgroundSubtractorGMG() AttributeError: 'module' object has no attribute 'createBackgroundSubtractorGMG'
Traceback (most recent call last): File "C:/PycharmProjects11/day5 ����/3 GMG��Ҷ˹�ָ�.py", line 9, in <module> fgbg = cv2.createBackgroundSubtractorGMG() AttributeError: 'module' object has no attribute 'createBackgroundSubtractorGMG'
1.问题描述:
opencv3 版本没有 createBackgroundSubtractorGMG和createBackgroundSubtractorGMG模块
2.查看opencv版本
C:UsersAdministrator>python Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19 tel)] on win32 Type "help", "copyright", "credits" or "license" for >>> import cv2 >>> cv2.__version__ '3.3.0' >>>
3.解决方案:
重新安装opencv2.x版本