don't display estimates on debug view/snapshots if object is not in a speed tracking zone

This commit is contained in:
Josh Hawkins 2025-01-08 09:48:41 -06:00
parent 642030a78b
commit c72efc28ab

View File

@ -220,6 +220,9 @@ class TrackedObject:
logger.debug( logger.debug(
f"Camera: {self.camera_config.name}, tracked object ID: {self.obj_data['id']}, zone: {name}, pixel velocity: {str(tuple(np.round(self.obj_data['estimate_velocity']).flatten().astype(int)))}, speed magnitude: {speed_magnitude}, velocity angle: {self.velocity_angle}, estimated speed: {self.current_estimated_speed:.1f}, average speed: {self.average_estimated_speed:.1f}, length: {len(self.speed_history)}" f"Camera: {self.camera_config.name}, tracked object ID: {self.obj_data['id']}, zone: {name}, pixel velocity: {str(tuple(np.round(self.obj_data['estimate_velocity']).flatten().astype(int)))}, speed magnitude: {speed_magnitude}, velocity angle: {self.velocity_angle}, estimated speed: {self.current_estimated_speed:.1f}, average speed: {self.average_estimated_speed:.1f}, length: {len(self.speed_history)}"
) )
else:
# ensure we do not display an estimate if the object is not currently in a speed tracking zone
self.current_estimated_speed = 0
# update loitering status # update loitering status
self.pending_loitering = in_loitering_zone self.pending_loitering = in_loitering_zone