first commit

This commit is contained in:
Bart Moyaers
2019-11-06 14:41:57 +01:00
commit 6aa165edb8
5 changed files with 231 additions and 0 deletions

22
bgsub_test.py Normal file
View File

@@ -0,0 +1,22 @@
from __future__ import print_function
import cv2 as cv
# backSub = cv.createBackgroundSubtractorMOG2()
backSub = cv.createBackgroundSubtractorKNN()
capture = cv.VideoCapture(0)
while True:
ret, frame = capture.read()
if frame is None:
break
fgMask = backSub.apply(frame)
cv.imshow('Frame', frame)
cv.imshow('FG Mask', fgMask)
keyboard = cv.waitKey(30)
if keyboard == 'q' or keyboard == 27:
break