Skip to content

Commit

Permalink
Adapt to the new semantic label format
Browse files Browse the repository at this point in the history
The non-zero second element does not indicate that the supervoxel should
not be agglomerated, instead, we agglomerate all supervoxels with
matching labels.
  • Loading branch information
ranlu committed Sep 30, 2024
1 parent 58b831c commit c0d256d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/agg/mean_aggl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ std::vector<sem_array_t> load_sem(const char * sem_filename, const std::vector<s
std::sort(std::execution::par, std::begin(sem_array), std::end(sem_array), [](auto & a, auto & b) { return a.first < b.first; });

for (auto & [k, v] : sem_array) {
if (sem_counts[k][0] > 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;
}
}
Expand Down Expand Up @@ -629,9 +629,6 @@ std::pair<size_t, size_t> 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 {
Expand Down

0 comments on commit c0d256d

Please sign in to comment.