Skip to content
Snippets Groups Projects
Commit 3a03faf5 authored by Petteri Laitinen's avatar Petteri Laitinen
Browse files

Upload New File

parent 2ebcbee7
No related branches found
No related tags found
No related merge requests found
Pipeline #25013 passed
test.py 0 → 100644
import bayesian_adapted_gmm_for_background_extraction as bayes
import cv2
# test one: successfully create a backgroundsubtractor
koeBayes=bayes.BackgroundSubtractorBayes(0.61,10,3)
# test two: successfully create a freimi:
cap = cv2.VideoCapture('test_video_1.mp4')
ret, frame = cap.read(88)
koeFreimi=bayes.freimi(8,frame)
# test three: successfully create a mask for entire set of frames of the test video
while(cap.isOpened() and frame_idx < cap.get(cv2.CAP_PROP_FRAME_COUNT) - 1):
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
#g2= BackgroundSubtractorBayes.apply(gray,0.7)
#g3=AltSub.apply(gray)
#g4=koeBayes.core.apply(gray)
g5=koeBayes.apply(gray,int(cap.get(cv2.CAP_PROP_POS_FRAMES)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment