add tracker ids to tracker boxes

This commit is contained in:
2024-07-19 17:31:34 +02:00
parent 32be3d17cd
commit 11ab3b6aa0
+3
View File
@@ -135,6 +135,9 @@ class CornerTracker:
tracker_rect = to_rect(bbox_round(self.tracking_bb)) tracker_rect = to_rect(bbox_round(self.tracking_bb))
cv2.rectangle(_image_anno, tracker_rect[0], tracker_rect[1], self.color, 1) cv2.rectangle(_image_anno, tracker_rect[0], tracker_rect[1], self.color, 1)
cv2.putText(_image_anno, f"{self.id}", (self.tracking_bb[0], self.tracking_bb[1] - 4),
cv2.FONT_HERSHEY_SIMPLEX, 0.8, self.color, 2)
@staticmethod @staticmethod
def mask_init(_image: np.array): def mask_init(_image: np.array):
# Create mask # Create mask