From 3711597433fb77aa39ecde1dea0f130b03ad8fd7 Mon Sep 17 00:00:00 2001 From: Piv <18462828+Piv200@users.noreply.github.com> Date: Sun, 31 May 2020 16:03:07 +0930 Subject: [PATCH] Start upgrading grouping algorithm to be more performant in python --- pycar/src/car/tracking/algorithms.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pycar/src/car/tracking/algorithms.py b/pycar/src/car/tracking/algorithms.py index 8f4df7a..13652e0 100644 --- a/pycar/src/car/tracking/algorithms.py +++ b/pycar/src/car/tracking/algorithms.py @@ -1,4 +1,5 @@ import math +import numpy as np class Group: @@ -134,6 +135,17 @@ def calc_groups(scan): return allGroups +def calc_groups_edge_algorithm(scan): + """ + Calculates groups using an edge algorithm. This takes advantage of numpy arrays + and vectorisation, rather than the primitive python loop grouping, resulting in + faster grouping speeds. + """ + allGroups = [] + scanArray = np.array(scan) + +def edge_algorithm(): + pass def find_centre(group): """