完美解决AttributeError: module ‘cv2.cv2‘ has no attribute ‘bgsegm
测试importnumpyasnpimportcv2cap=cv2.VideoCapture('vtest.avi')fgbg=cv2.bgsegm.createBackgroundSubtractorMOG()while(1):ret,frame=cap.read()fgmask=fgbg.apply(frame)cv2.imshow('frame',fgmask)k=cv2.waitKey(3