Start upgrading grouping algorithm to be more performant in python

This commit is contained in:
Piv
2020-05-31 16:03:07 +09:30
parent e54db7c007
commit 3711597433

View File

@@ -1,4 +1,5 @@
import math import math
import numpy as np
class Group: class Group:
@@ -134,6 +135,17 @@ def calc_groups(scan):
return allGroups 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): def find_centre(group):
""" """