Resolution control via MQTT
Change-Id: I3a98f19fac8a34098703c7bdf60e1e17f644a635
diff --git a/person_detection/person_detection.py b/person_detection/person_detection.py
index aa54601..15c4e82 100644
--- a/person_detection/person_detection.py
+++ b/person_detection/person_detection.py
@@ -17,6 +17,8 @@
from base_camera import BaseCamera
+import mqtt
+
Shape = namedtuple('Shape', ['n','c','h','w'])
class Camera(BaseCamera):
@@ -36,6 +38,8 @@
self.device = device
+ mqtt.init(device)
+
super(Camera, self).__init__(device, args.idle)
def __del__(self):
@@ -145,6 +149,9 @@
cv2.putText(frame, "camera: {}".format(self.device), (10, int(initial_h - 20)),
cv2.FONT_HERSHEY_COMPLEX, 0.6, black, 1)
+ if obj_count > 0:
+ mqtt.person_detected(self.device, obj_count)
+
yield cv2.imencode('.jpg', frame)[1].tobytes()
if self.is_async_mode: