Skip to content

Commit ef3d7d7

Browse files
solving tracked objects
1 parent 31b7c0e commit ef3d7d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

simple_filters/tracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def update(self, states):
7878
## Build the distance matrix and match objects
7979
# We build a matrix that contains the distances of the tracked objects
8080
# with its predicted state (determined by the filter) and the new states which just came in
81-
if number_of_tracked_objects > 0:
81+
if number_of_tracked_objects > 0 and number_of_states > 0:
8282

8383
# Calculate the distance matrix, the complexity is n^2
8484
distance_matrix = np.zeros((number_of_tracked_objects, number_of_states))

tests/test_single_object_tracking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def test_main(self):
3030
tracked_state = self.tracker.get_tracked_objects()
3131

3232
self.assertEqual(1, len(tracked_state))
33-
self.assertEqual(tracked_state[0].id, expected_tracking_id)
33+
self.assertEqual(tracked_state[0].id, expected_tracking_id)

0 commit comments

Comments
 (0)