Use different box variation to designate when an object is stationary on debug

This commit is contained in:
Nick Mowen 2024-01-18 14:16:51 -07:00 committed by Nicolas Mowen
parent 7b049c1782
commit ce36fd16af
2 changed files with 7 additions and 5 deletions

View File

@ -489,6 +489,10 @@ class CameraState:
# draw the bounding boxes on the frame
for obj in tracked_objects.values():
if obj["frame_time"] == frame_time:
if obj["stationary"]:
color = (220, 220, 220)
thickness = 1
else:
thickness = 2
color = self.config.model.colormap[obj["label"]]
else:

View File

@ -220,9 +220,7 @@ class NorfairTracker(ObjectTracker):
id = self.track_id_map[track_id]
self.disappeared[id] = 0
# update the motionless count if the object has not moved to a new position
if self.update_position(
id, obj["box"], self.tracked_objects[id]["motionless_count"] > 1
):
if self.update_position(id, obj["box"]):
self.tracked_objects[id]["motionless_count"] += 1
if self.is_expired(id):
self.deregister(id, track_id)