-
Notifications
You must be signed in to change notification settings - Fork 0
/
verifyDetectionLevel.py
40 lines (32 loc) · 1.1 KB
/
verifyDetectionLevel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from utils import motionDetection
from time import sleep
import os
from pathlib import Path
import json
import cv2
detectMotion = motionDetection()
for item in detectMotion.subStreamDirPaths:
#Sort all files
detectMotion._listTimeSortedFiles(item)
folderIsEmpty = False
while folderIsEmpty is False:
if detectMotion.list_of_files:
file1 = detectMotion.list_of_files[0]
detectMotion.list_of_files.pop(0)
else:
folderIsEmpty = True
if detectMotion.list_of_files:
file2 = detectMotion.list_of_files[0]
detectMotion.list_of_files.pop(0)
else:
folderIsEmpty = True
detection,diff_value = detectMotion.motionDetectSingleCam(file1, file2, 230000)
print(diff_value)
if detection is True:
img1 = cv2.imread(file1)
img2 = cv2.imread(file2)
print(diff_value)
cv2.imshow('file1', img1)
cv2.imshow('file2', img2)
cv2.waitKey(5000)
cv2.destroyAllWindows()