0

i used the below code from http://docs.opencv.org/master/db/d5c/tutorial_py_bg_subtraction.html#gsc.tab=0

import numpy as np
import cv2

cap = cv2.VideoCapture(0)

fgbg = cv2.createBackgroundSubtractorMOG2()

while(1):
    ret, frame = cap.read()

    fgmask = fgbg.apply(frame)

    cv2.imshow('frame',fgmask)
    k = cv2.waitKey(30) & 0xff
    if k == 27:
        break

cap.release()
cv2.destroyAllWindows()

I have added opencv_ffmpeg310.dll to PATH too. Please help

Avinash S
  • 31
  • 1
  • 6
  • If you a python stack traceback, it might help if you included it in your question. – J.J. Hakala Jan 24 '16 at 10:46
  • thank u. anyway i have solved it just now. It was a bug with opencv 3.1.0 it seems. I installed opencv-python 2.4.12 now removing that. and changed `cv2.createBackgroundSubtractorMOG2()` to this `cv2.BackgroundSubtractorMOG2()` – Avinash S Jan 24 '16 at 15:38

0 Answers0