More fixes for #27

This commit is contained in:
boltgolt 2018-05-03 16:12:17 +02:00
parent ad2bfd50c5
commit 2002f4c6b5
4 changed files with 18 additions and 0 deletions

View file

@ -80,6 +80,12 @@ insert_model = {
# Open the camera
video_capture = cv2.VideoCapture(int(config.get("video", "device_id")))
# Force MJPEG decoding if true
if config.get("debug", "force_mjpeg") == "true":
video_capture.set(cv2.CAP_PROP_FOURCC, 1196444237)
# Request a frame to wake the camera up
video_capture.read()
print("\nPlease look straight into the camera")

View file

@ -20,6 +20,10 @@ config.read(path + "/../config.ini")
# Start capturing from the configured webcam
video_capture = cv2.VideoCapture(int(config.get("video", "device_id")))
# Force MJPEG decoding if true
if config.get("debug", "force_mjpeg") == "true":
video_capture.set(cv2.CAP_PROP_FOURCC, 1196444237)
# Let the user know what's up
print("""
Opening a window with a test feed

View file

@ -60,6 +60,10 @@ timings.append(time.time())
# Start video capture on the IR camera
video_capture = cv2.VideoCapture(int(config.get("video", "device_id")))
# Force MJPEG decoding if true
if config.get("debug", "force_mjpeg") == "true":
video_capture.set(cv2.CAP_PROP_FOURCC, 1196444237)
# Capture a single frame so the camera becomes active
# This will let the camera adjust its light levels while we're importing for faster scanning
video_capture.read()

View file

@ -33,6 +33,10 @@ device_id = 1
# Speeds up face recognition but can make it less precise
max_height = 320
# Force the use of Motion JPEG when decoding frames, fixes issues with
# YUYV raw frame deconding
force_mjpeg = false
# Because of flashing IR emitters, some frames can be completely unlit
# Skip the frame if the lowest 1/8 of the histogram is above this percentage
# of the total