From c0d256d51bb784672d4b96633562195fa8dca169 Mon Sep 17 00:00:00 2001 From: Ran Lu Date: Mon, 28 Aug 2023 22:05:30 -0400 Subject: [PATCH] Adapt to the new semantic label format The non-zero second element does not indicate that the supervoxel should not be agglomerated, instead, we agglomerate all supervoxels with matching labels. --- src/agg/mean_aggl.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/agg/mean_aggl.cpp b/src/agg/mean_aggl.cpp index 7698061..962bc37 100644 --- a/src/agg/mean_aggl.cpp +++ b/src/agg/mean_aggl.cpp @@ -269,10 +269,10 @@ std::vector load_sem(const char * sem_filename, const std::vector 0 and v[0] > 0 and v[0] != sem_counts[k][0]) { - sem_counts[k][1] = 1; + if (v[0] == 0) { + continue; } - if (v[0] > 0) { + if (sem_counts[k][0] == 0 or v[1] > sem_counts[k][1]) { sem_counts[k] = v; } } @@ -629,9 +629,6 @@ std::pair sem_label(const sem_array_t & labels) bool sem_can_merge(const sem_array_t & labels1, const sem_array_t & labels2, const agglomeration_semantic_heuristic_t & sem_params) { - if (labels1[1] > 0 or labels2[1] > 0) { - return false; - } if (labels1[0] == 0 or labels2[0] == 0 or labels1[0] == labels2[0]) { return true; } else {