From 65a53e4df53e341783b82f10fdc116fa459fe61c Mon Sep 17 00:00:00 2001 From: Piv <18462828+Piv200@users.noreply.github.com> Date: Tue, 17 Mar 2020 21:49:36 +1030 Subject: [PATCH] Fix minor bugs in algorithms --- tracking/algorithms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tracking/algorithms.py b/tracking/algorithms.py index 53d7bc4..8619fad 100644 --- a/tracking/algorithms.py +++ b/tracking/algorithms.py @@ -119,12 +119,12 @@ def assign_groups(prev_groups, new_groups): Assigns group numbers to a new scan based on the groups of an old scan. """ for group in prev_groups: - old_centre = find_centre(prev_groups) + old_centre = find_centre(group) for new_group in new_groups: new_centre = find_centre(new_group) # They are considered the same if the new group and old group centres are within 5cm. if ((new_centre[0] - old_centre[0]) ** 2 + (new_centre[1] - old_centre[1]) ** 2) < 50 ** 2: - new_group.set_number(group.get_number()) + new_group.number = group.number return new_groups