Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import cv2
- cap = cv2.VideoCapture("E:/Ob_Extraction/SourceImage/video/vid2.mp4")
- 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()
Add Comment
Please, Sign In to add comment