Open bedfl2016 opened 5 years ago
I'm having the same problem
you can change the code cv2.BackgroundSubtractorMOG2(0,10) to cv2.createBackgroundSubtractorMOG2(0,10)
its already cv2.createBackgroundSubtractorMOG2(0,10) and still the error coming
change the code cv2.BackgroundSubtractorMOG2(0,10) to cv2.createBackgroundSubtractorMOG2(0,10),it's right.and,you need change contours,hierarchy=cv2.findContours(contour_frame,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) to frame,contours,hierarchy=cv2.findContours(contour_frame,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE),if you use opencv 3.
When I press b to capture background I get this error Traceback (most recent call last): File "C:\Users\laure\OneDrive\Desktop\hand-gesture-recognition-opencv-master\HandRecognition.py", line 191, in
fg_frame=remove_bg(frame)
File "C:\Users\laure\OneDrive\Desktop\hand-gesture-recognition-opencv-master\HandRecognition.py", line 167, in remove_bg
fg_mask=bg_model.apply(frame)
TypeError: Incorrect type of self (must be 'BackgroundSubtractorMOG2' or its derivative)
[Finished in 8.6s]