Guest User

Untitled

a guest
Feb 25th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import numpy as np
  2. import cv2
  3.  
  4. cap = cv2.VideoCapture("E:/Ob_Extraction/SourceImage/video/vid2.mp4")
  5.  
  6. fgbg = cv2.createBackgroundSubtractorMOG()
  7.  
  8. while(1):
  9. ret, frame = cap.read()
  10.  
  11. fgmask = fgbg.apply(frame)
  12.  
  13. cv2.imshow('frame',fgmask)
  14. k = cv2.waitKey(30) & 0xff
  15. if k == 27:
  16. break
  17.  
  18. cap.release()
  19. cv2.destroyAllWindows()
Add Comment
Please, Sign In to add comment