From 54f5d53bb92359d55c5e3a62428d3c79afdb3a53 Mon Sep 17 00:00:00 2001 From: Christian C Date: Wed, 5 Mar 2025 16:29:31 -0800 Subject: Include perimeter information --- src/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.c b/src/main.c index 3393e89..cf1709d 100644 --- a/src/main.c +++ b/src/main.c @@ -170,16 +170,24 @@ int main(int argc, char** argv) CloseWindow(); #else if (masks != NULL) { + TIME(ts_start); for (size_t y = 0; y < height; y++) { for (size_t x = 0; x < width; x++) { if (masks[x + y*width] != 0) { root = increase_label_area_alloc(root, masks[x + y*width]); + if (is_on_mask_boundary(masks, width, height, x, y)) { + increase_label_perimeter(root, masks[x + y*width]); + } } } } + TIME(ts_end); + printf("Information retrieval took %f ms\n", 1000*diff_time(&ts_end, &ts_start)); +#ifdef AVL_INFO printf("Inorder traversal of AVL tree: "); print_label(root); printf("\n"); +#endif free_avl_tree_nodes(root); root = NULL; write_array("../out.bin", masks, width*height*sizeof(uint16_t)); -- cgit v1.2.1