-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capture background issue #15
Comments
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]
The text was updated successfully, but these errors were encountered: