From bd02f998f2bf00fad5255f43ad0621a80d94ee83 Mon Sep 17 00:00:00 2001 From: dmig Date: Wed, 21 Nov 2018 11:32:28 +0700 Subject: [PATCH] remove last config access from main cycle --- src/compare.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compare.py b/src/compare.py index dca8a88..24c4a15 100644 --- a/src/compare.py +++ b/src/compare.py @@ -91,6 +91,7 @@ frames = 0 timeout = config.getint("video", "timout") dark_threshold = config.getfloat("video", "dark_threshold") end_report = config.getboolean("debug", "end_report") +video_certainty = config.getfloat("video", "certainty") / 10 while True: # Increment the frame count every loop frames += 1 @@ -145,7 +146,7 @@ while True: match_index += 1 # Try to find a match that's confident enough - if match * 10 < float(config.get("video", "certainty")) and match > 0: + if 0 < match < video_certainty: timings.append(time.time()) # If set to true in the config, print debug text