mirror of
https://github.com/boltgolt/howdy.git
synced 2024-09-19 09:51:19 +02:00
proper cam init time measuring
This commit is contained in:
parent
c90d977352
commit
f4d231cca8
1 changed files with 4 additions and 5 deletions
|
@ -65,8 +65,7 @@ timings['st'] = time.time() - timings['st']
|
||||||
video_capture = None
|
video_capture = None
|
||||||
|
|
||||||
def initialize_cam():
|
def initialize_cam():
|
||||||
global video_capture, timings
|
global video_capture
|
||||||
timings['ic'] = time.time()
|
|
||||||
|
|
||||||
# Start video capture on the IR camera
|
# Start video capture on the IR camera
|
||||||
video_capture = cv2.VideoCapture(config.get("video", "device_path"))
|
video_capture = cv2.VideoCapture(config.get("video", "device_path"))
|
||||||
|
@ -89,9 +88,7 @@ def initialize_cam():
|
||||||
# This will let the camera adjust its light levels while we're importing for faster scanning
|
# This will let the camera adjust its light levels while we're importing for faster scanning
|
||||||
video_capture.grab()
|
video_capture.grab()
|
||||||
|
|
||||||
# Note the time it took to open the camera
|
timings['ic'] = time.time()
|
||||||
timings['ic'] = time.time() - timings['ic']
|
|
||||||
|
|
||||||
init_thread = Thread(target=initialize_cam)
|
init_thread = Thread(target=initialize_cam)
|
||||||
init_thread.start()
|
init_thread.start()
|
||||||
|
|
||||||
|
@ -121,6 +118,8 @@ timings['ll'] = time.time() - timings['ll']
|
||||||
# wait for camera initialization to finish
|
# wait for camera initialization to finish
|
||||||
init_thread.join()
|
init_thread.join()
|
||||||
del init_thread
|
del init_thread
|
||||||
|
# Note the time it took to open the camera
|
||||||
|
timings['ic'] = time.time() - timings['ic']
|
||||||
|
|
||||||
# Fetch the max frame height
|
# Fetch the max frame height
|
||||||
max_height = config.getfloat("video", "max_height", fallback=0.0)
|
max_height = config.getfloat("video", "max_height", fallback=0.0)
|
||||||
|
|
Loading…
Reference in a new issue