-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcamera2c.py
More file actions
34 lines (29 loc) · 739 Bytes
/
camera2c.py
File metadata and controls
34 lines (29 loc) · 739 Bytes
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
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Initation and configuration of openCV
"""
import cv2
import time
import numpy as np
storepath = time.strftime("%m%d", time.localtime())+"/"+time.strftime("%H",time.localtime())
## select VideoCapture device
#cap = cv2.VideoCapture(0)
cap = cv2.VideoCapture("/dev/video0")
cap.set(3,800)
cap.set(4,600)
def live():
ret, frame = cap.read()
frame=cv2.transpose(frame)
return frame
def seq_capt(interval):
## TIFF :
try:
record = open(storepath+"log.txt", 'w')
record.write("Start Time:"+time.strftime("%Y-%m-%d-%H:%M",time.localtime()))
record.write("\n"+str(cam_sav.getParameters()))
#record.write(data)
finally:
if record:
record.close()
live()