-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItFuncs.py
31 lines (26 loc) · 909 Bytes
/
ItFuncs.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
import os
import datetime
def construct_file():
dt = datetime.datetime.now()
# https://tecadmin.net/get-current-date-time-python/
# https://docs.python.org/3/library/datetime.html
# print(dt)
# print ("Current Year is: %d" % dt.year)
# print ("Current Month is: %d" % dt.month)
# print ("Current Day is: %d" % dt.day)
# print ("Current Hour is: %d" % dt.hour)
# print ("Current Minute is: %d" % dt.minute)
# print ("Current Second is: %d" % dt.second)
camtime = str(dt.year) + "_"\
+str(dt.month) + "_"\
+str(dt.day) + "_"\
+str(dt.hour) + "_"\
+str(dt.minute) + "_"\
+str(dt.second)
fileloc = os.getcwd()
camfile = os.path.join(fileloc,camtime)
return camfile
# function to get the initial image to compare for motion detection
def get_base_image(camera):
retimage, im = camera.read()
return im