From 1b6c07376aaecaa90e05a136375038ae8c3436b5 Mon Sep 17 00:00:00 2001 From: Marcus Brown Date: Sun, 20 Oct 2024 18:12:12 +1100 Subject: [PATCH] Fix MQTT client configuration and add image analysis improvements - Updated MQTT client to use MQTTv5 without deprecated `clean_session` to resolve ValueError. - Fine-tuned color thresholds for better dayglo detection accuracy. - Added cropping to focus analysis on the central area of the image for improved rating calculation. - Provided command-line option for analyzing specific images, enabling debugging and fine-tuning. --- dayglo_detector/dayglo_detector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dayglo_detector/dayglo_detector.py b/dayglo_detector/dayglo_detector.py index fc344cc..92e7233 100644 --- a/dayglo_detector/dayglo_detector.py +++ b/dayglo_detector/dayglo_detector.py @@ -131,7 +131,7 @@ if len(sys.argv) > 1: print(f"File not found: {image_file}") # Set up MQTT client for normal operation -client = mqtt.Client(client_id='', clean_session=True, protocol=mqtt.MQTTv5) +client = mqtt.Client(protocol=mqtt.MQTTv5) client.username_pw_set(MQTT_USERNAME, MQTT_PASSWORD) client.on_connect = on_connect client.on_message = on_message