Improve variable naming

This commit is contained in:
tc360950
2024-05-29 18:34:35 +02:00
parent d6ae86e97b
commit dc1249969f
+5 -6
View File
@@ -167,20 +167,19 @@ class LineZone:
# Calculate which anchors lie to the left of the line
triggers = self._cross_product(all_anchors, self.vector) < 0
# Reduce to find out if all anchors for a
# detection lie to the left (or right) of the line
max_triggers = np.max(triggers, axis=0)
min_triggers = np.min(triggers, axis=0)
has_any_left_trigger = np.any(triggers, axis=0)
has_any_right_trigger = np.any(~triggers, axis=0)
is_uniformly_triggered = ~(has_any_left_trigger & has_any_right_trigger)
for i, tracker_id in enumerate(detections.tracker_id):
if not in_limits[i]:
continue
if min_triggers[i] != max_triggers[i]:
if not is_uniformly_triggered[i]:
# One anchor lies to the left of the line
# whilst another lies to the right
continue
tracker_state = max_triggers[i]
tracker_state = has_any_left_trigger[i]
if tracker_id not in self.tracker_state:
self.tracker_state[tracker_id] = tracker_state
continue