Skip to content

Commit

Permalink
Fix webcam warmup time variable
Browse files Browse the repository at this point in the history
  • Loading branch information
theyosh committed Jul 16, 2017
1 parent e2e26b6 commit b82b403
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions terrariumWebcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, id, location, name = '', rotation = None):
self.tile_location = 'webcam/'
self.font_size = 10
self.retries = 3
self.webam_warm_up = 2
self.webcam_warm_up = 2

# Per webcam config
self.set_location(location)
Expand Down Expand Up @@ -117,8 +117,8 @@ def __get_raw_image_rpicam(self):
with PiCamera(resolution=(1920, 1080)) as camera:
logger.debug('Open rpicam')
camera.start_preview()
logger.debug('Wait %s seconds for preview' % (self.webam_warm_up,))
sleep(self.webam_warm_up)
logger.debug('Wait %s seconds for preview' % (self.webcam_warm_up,))
sleep(self.webcam_warm_up)
logger.debug('Save rpicam to jpeg')
camera.capture(stream, format='jpeg')
logger.debug('Done creating RPICAM image')
Expand All @@ -142,7 +142,7 @@ def __get_raw_image_usb(self):
logger.debug('Set USB width to 720')
camera.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 720)
logger.debug('Wait 2 seconds for preview')
sleep(2)
sleep(self.webcam_warm_up)
logger.debug('Save USB to raw data')
readok, image = camera.read()

Expand Down

0 comments on commit b82b403

Please sign in to comment.