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.
This commit is contained in:
2024-10-20 18:12:12 +11:00
parent 994e814823
commit 1b6c07376a
+1 -1
View File
@@ -131,7 +131,7 @@ if len(sys.argv) > 1:
print(f"File not found: {image_file}") print(f"File not found: {image_file}")
# Set up MQTT client for normal operation # 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.username_pw_set(MQTT_USERNAME, MQTT_PASSWORD)
client.on_connect = on_connect client.on_connect = on_connect
client.on_message = on_message client.on_message = on_message