From 4a58f16637eb16729fc20b1e201ce45fc09263f3 Mon Sep 17 00:00:00 2001 From: blakeblackshear Date: Sat, 13 Jul 2019 07:40:32 -0500 Subject: [PATCH] tweak the label position --- frigate/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/util.py b/frigate/util.py index c02b4f4a7..c73939247 100644 --- a/frigate/util.py +++ b/frigate/util.py @@ -19,8 +19,8 @@ def draw_box_with_label(frame, x_min, y_min, x_max, y_max, label): line_height = text_height + size[1] # set the text start position text_offset_x = x_min - text_offset_y = 0 if y_min < line_height else y_min - line_height + text_offset_y = 0 if y_min < line_height else y_min - (line_height+8) # make the coords of the box with a small padding of two pixels textbox_coords = ((text_offset_x, text_offset_y), (text_offset_x + text_width + 2, text_offset_y + line_height)) cv2.rectangle(frame, textbox_coords[0], textbox_coords[1], color, cv2.FILLED) - cv2.putText(frame, label, (text_offset_x, text_offset_y + line_height - 2), font, fontScale=font_scale, color=(0, 0, 0), thickness=2) \ No newline at end of file + cv2.putText(frame, label, (text_offset_x, text_offset_y + line_height - 3), font, fontScale=font_scale, color=(0, 0, 0), thickness=2) \ No newline at end of file