Skip to content

Commit

Permalink
fixed implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksa-M committed Dec 19, 2024
1 parent fe6c9e8 commit 8991dc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions modules/cluster_estimation/cluster_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class ClusterEstimation:
__filter_by_covariances()
Removes any cluster with covariances much higher than the lowest covariance value.
"""

__create_key = object()
Expand Down Expand Up @@ -179,12 +178,13 @@ def run(

# init search parameters
ptr = 0
max_label = self.__current_bucket[0][2]

# itterates through all possible labels
for label in reversed(range(max_label)):
# itterates through all points
while ptr <= len(self.__current_bucket):
# reference label
label = self.__current_bucket[ptr][2]

# creates bucket of labels
# creates bucket of points with the same label
bucket_labelled = []
while ptr < len(self.__current_bucket) and self.__current_bucket[ptr][2] == label:
bucket_labelled += [self.__current_bucket[ptr]]
Expand All @@ -200,7 +200,9 @@ def run(

# checks if cluster_by_label ran succssfully
if not check:
self.__logger(f"did not add objects of label={label} to total object detections")
self.__logger.warning(
f"did not add objects of label={label} to total object detections"
)
continue

detections_in_world += labelled_detections_in_world
Expand Down

0 comments on commit 8991dc7

Please sign in to comment.