0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-19 09:51:19 +02:00

Fixed devision by zero issue from #44

This commit is contained in:
boltgolt 2018-06-07 21:32:08 +02:00
parent 5e72907853
commit 334da6e3a5
No known key found for this signature in database
GPG key ID: BECEC9937E1AAE26

View file

@ -97,6 +97,11 @@ while True:
# All values combined for percentage calculation
hist_total = int(sum(hist)[0])
# If the image is fully black, skip to the next frame
if hist_total == 0:
dark_tries += 1
continue
# Scrip the frame if it exceeds the threshold
if float(hist[0]) / hist_total * 100 > float(config.get("video", "dark_threshold")):
dark_tries += 1