diff options
author | Christian C <cc@localhost> | 2025-03-05 16:29:31 -0800 |
---|---|---|
committer | Christian C <cc@localhost> | 2025-03-05 16:29:31 -0800 |
commit | 54f5d53bb92359d55c5e3a62428d3c79afdb3a53 (patch) | |
tree | dbb7bbba64d1bd3612248a8be48a7b2b5640f35c /src | |
parent | 12de92c487469b44912c614fc21038cdb07c1a81 (diff) |
Include perimeter information
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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)); |