diff options
author | Christian C <cc@localhost> | 2025-03-07 22:27:12 -0800 |
---|---|---|
committer | Christian C <cc@localhost> | 2025-03-07 22:27:12 -0800 |
commit | fb290d22289f9c29eef504a538f7a293844a624d (patch) | |
tree | 801ad4900c58c2c80baff22cf80f54968f15c615 | |
parent | 473bcd599f9378583c4bc72764fc2f445e0d2768 (diff) |
-rw-r--r-- | src/prog.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -15,11 +15,6 @@ #include <lib/seg/util.h> #include <lib/seg/mask_data.h> -#define OFFSET 16 - -#define MIN_AREA 500 -#define MIN_PERIMETER 0 - int main(int argc, char** argv) { char opt; @@ -27,15 +22,23 @@ int main(int argc, char** argv) char* png_file = "../out.png"; char* bin_file = "../out.bin"; size_t closeup_pixel_count = 10; + size_t min_area = 500; + size_t min_perimeter = 0; bool_t silent = FALSE; //----------------------------------------------- //-GET-COMMAND-LINE-ARGUMENTS-------------------- //----------------------------------------------- - while ((opt = getopt(argc, argv, "d:b:p:n:s")) != -1) { + while ((opt = getopt(argc, argv, "d:b:p:n:sA:P:")) != -1) { switch (opt) { case 's': silent = TRUE; break; + case 'A': + min_area = atoi(optarg); + break; + case 'P': + min_perimeter = atoi(optarg); + break; case 'd': if (!silent) { printf("Parse Directory: %s\n", optarg); @@ -149,7 +152,7 @@ int main(int argc, char** argv) //-FILTER-SMALL-REGIONS-OUT---------------------- //----------------------------------------------- TIME(ts_filter_start); - filter_small_masks(masks, width, height, MIN_AREA, MIN_PERIMETER); + filter_small_masks(masks, width, height, min_area, min_perimeter); TIME(ts_filter_end); if (!silent) { printf("Removing small labels took %f ms\n", 1000*diff_time(&ts_filter_end, &ts_filter_start)); |