Ask Your Question

irfan shah's profile - activity

2016-12-27 21:55:46 -0600 received badge  Notable Question (source)
2015-12-08 16:23:19 -0600 received badge  Popular Question (source)
2014-09-29 10:16:22 -0600 received badge  Student (source)
2014-02-24 11:08:19 -0600 commented answer Background Subtractiom

yes right i take it from 3 tutorials . but three of them are different methods but when I run any of them it give same error . so what can I do ??

2014-02-24 11:04:48 -0600 received badge  Critic (source)
2014-02-22 12:19:47 -0600 asked a question Background Subtractiom

friend i want to read a video in frames along with background subtraction . but when i run opencv background subtraction code it give error and didn,t run .!! please help me ..!! Here is the Code ..

import numpy as np
import cv2

cap = cv2.VideoCapture('vtest.avi')

fgbg = cv2.createBackgroundSubtractorMOG()

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()

it show me this error :

Traceback (most recent call last):
  File "C:/Users/shah/Desktop/back ground", line 7, in <module>
    fgbg = cv2.createBackgroundSubtractorMOG()
AttributeError: 'module' object has no attribute 'createBackgroundSubtractorMOG'
                             Thanks