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,8 +489,12 @@ class CameraState:
# draw the bounding boxes on the frame # draw the bounding boxes on the frame
for obj in tracked_objects.values(): for obj in tracked_objects.values():
if obj["frame_time"] == frame_time: if obj["frame_time"] == frame_time:
thickness = 2 if obj["stationary"]:
color = self.config.model.colormap[obj["label"]] color = (220, 220, 220)
thickness = 1
else:
thickness = 2
color = self.config.model.colormap[obj["label"]]
else: else:
thickness = 1 thickness = 1
color = (255, 0, 0) color = (255, 0, 0)

View File

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