Use int for drawing box (#8388)

This commit is contained in:
Nicolas Mowen 2023-10-30 17:53:29 -06:00 committed by GitHub
parent 159fb51518
commit f1efd8dbe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,10 +106,10 @@ class ExternalEventProcessor:
# write jpg snapshot with optional annotations # write jpg snapshot with optional annotations
if draw.get("boxes") and isinstance(draw.get("boxes"), list): if draw.get("boxes") and isinstance(draw.get("boxes"), list):
for box in draw.get("boxes"): for box in draw.get("boxes"):
x = box["box"][0] * camera_config.detect.width x = int(box["box"][0] * camera_config.detect.width)
y = box["box"][1] * camera_config.detect.height y = int(box["box"][1] * camera_config.detect.height)
width = box["box"][2] * camera_config.detect.width width = int(box["box"][2] * camera_config.detect.width)
height = box["box"][3] * camera_config.detect.height height = int(box["box"][3] * camera_config.detect.height)
draw_box_with_label( draw_box_with_label(
img_frame, img_frame,