Skip to content
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

Open
bedfl2016 opened this issue Feb 24, 2019 · 4 comments
Open

Capture background issue #15

bedfl2016 opened this issue Feb 24, 2019 · 4 comments

Comments

@bedfl2016
Copy link

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]

@anantSinghCross
Copy link

I'm having the same problem

@ladybirdhui
Copy link

you can change the code cv2.BackgroundSubtractorMOG2(0,10) to cv2.createBackgroundSubtractorMOG2(0,10)

@PR-Iyyer
Copy link

its already cv2.createBackgroundSubtractorMOG2(0,10) and still the error coming

@FUZIRONG
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants