aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorChristian C <cc@localhost>2025-03-05 19:58:33 -0800
committerChristian C <cc@localhost>2025-03-05 19:58:33 -0800
commit5b3cb257506f3fbe8c5ad3ea8aedb87d51e4c87c (patch)
treeb96b9d3512afcd0bb872ec86bb393be6cbd259fe /src/main.c
parentb68a9a6263610bb0a5ada53695e025daf1209fcb (diff)
Filter small labels
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index e199c43..8ee035f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -180,6 +180,7 @@ int main(int argc, char** argv)
CloseWindow();
#else
if (masks != NULL) {
+ // Get the area/ perimeter of each label
TIME(ts_start);
for (size_t y = 0; y < height; y++) {
for (size_t x = 0; x < width; x++) {
@@ -198,6 +199,10 @@ int main(int argc, char** argv)
print_label(root);
printf("\n");
#endif
+ // Get the smallest labels
+ struct AVLNode* small_label_tree = NULL;
+ small_label_tree = get_small_labels(NULL, root, 50, 50);
+ free_avl_tree(small_label_tree);
free_avl_tree_nodes(root);
root = NULL;
write_array("../out.bin", masks, width*height*sizeof(uint16_t));