From 9c6ca913d0b7f9b9ae95f72d6187944a8a940228 Mon Sep 17 00:00:00 2001 From: Christian C Date: Thu, 6 Mar 2025 15:34:34 -0800 Subject: Simplify execution --- include/lib/seg/util.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/lib/seg/util.h') diff --git a/include/lib/seg/util.h b/include/lib/seg/util.h index fcafff6..c54b0e0 100644 --- a/include/lib/seg/util.h +++ b/include/lib/seg/util.h @@ -13,13 +13,13 @@ size_t xy_to_coord(size_t x, size_t y, uint32_t width, uint32_t height); bool_t is_on_mask_boundary(uint16_t* mask, uint32_t width, uint32_t height, size_t x, size_t y); // Dilate masks by one 4-connected pixel -uint16_t* dilate(uint16_t* mask, uint32_t width, uint32_t height); +void dilate(uint16_t** mask, uint32_t width, uint32_t height); // Erode masks by one 4-connected pixel -uint16_t* erode(uint16_t* mask, uint32_t width, uint32_t height); +void erode(uint16_t** mask, uint32_t width, uint32_t height); // Close up masks by N-pixels -uint16_t* closeup(uint16_t* mask, uint32_t width, uint32_t height, size_t count); +void closeup(uint16_t** mask, uint32_t width, uint32_t height, size_t count); // Combine Label Masks // For all empty spaces in the destination, put the extra label if it exists @@ -34,4 +34,9 @@ uint16_t* tif_to_labels(char* tif_file_name, uint32_t *width, uint32_t *height, // Convert mask to bitmap struct bitmap_t* uint16_to_bitmap(uint16_t* buffer, uint32_t width, uint32_t height); +// Reduce a mask to the contiguous regions +// Automatically update pointer to contiguous mask +// Freeing previous mask +void reduce_contiguous_regions(uint16_t** masks_p, uint32_t width, uint32_t height, uint16_t* total_labels); + #endif -- cgit v1.2.1