Rework the webcam detection
This commit is contained in:
@@ -105,9 +105,9 @@ class Printer(object):
|
||||
clean_msg = str(msg)
|
||||
clean_signature = str(signature)
|
||||
|
||||
if len(clean_msg) > 256 or len(clean_msg) < 3 :
|
||||
if len(clean_msg) > 4096 or len(clean_msg) < 3 :
|
||||
self.app.logger.warning("Could not print message of this length: " + str(len(clean_msg)))
|
||||
raise Exception("Could not print message of this length :" + str(len(clean_msg)) + ", needs to between 3 and 256 caracters long.")
|
||||
raise Exception("Could not print message of this length :" + str(len(clean_msg)) + ", needs to between 3 and 4096 caracters long.")
|
||||
|
||||
if len(signature) > 256 or len(signature) < 3:
|
||||
self.app.logger.warning("Could not print signature of this length: " + str(len(clean_signature)))
|
||||
@@ -176,8 +176,8 @@ class Printer(object):
|
||||
|
||||
def process_image(self, path):
|
||||
brightness_factor = 1.5 # Used only if image is too dark
|
||||
brightness_threshold = 150 # Brightness threshold (0–255)
|
||||
contrast_factor = 1.2 # Less than 1.0 = lower contrast
|
||||
brightness_threshold = 100 # Brightness threshold (0–255)
|
||||
contrast_factor = 0.6 # Less than 1.0 = lower contrast
|
||||
max_width = 575
|
||||
max_height = 1000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user