diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -21,8 +21,6 @@ #define OFFSET 16 -#define N_DILATIONS 10 - #define MIN_AREA 500 #define MIN_PERIMETER 0 @@ -32,11 +30,12 @@ int main(int argc, char** argv) char* directory = NULL; char* png_file = "../out.png"; char* bin_file = "../out.bin"; + size_t closeup_pixel_count = 10; bool_t silent = FALSE; //----------------------------------------------- //-GET-COMMAND-LINE-ARGUMENTS-------------------- //----------------------------------------------- - while ((opt = getopt(argc, argv, "d:b:p:s")) != -1) { + while ((opt = getopt(argc, argv, "d:b:p:n:s")) != -1) { switch (opt) { case 's': silent = TRUE; @@ -59,6 +58,13 @@ int main(int argc, char** argv) } png_file = optarg; break; + case 'n': + if (!silent) { + printf("Closeup Size: %d\n", atoi(optarg)); + closeup_pixel_count = atoi(optarg); + } + png_file = optarg; + break; case ':': if (!silent) { printf("Option requires value\n"); @@ -181,7 +187,7 @@ int main(int argc, char** argv) //-CLOSE-UP-SMALL-GAPS-BETWEEN-REGIONS----------- //----------------------------------------------- TIME(ts_start); - closeup(&masks, width, height, N_DILATIONS); + closeup(&masks, width, height, closeup_pixel_count); TIME(ts_end); if (!silent) { printf("Closing up took %f ms\n", 1000*diff_time(&ts_end, &ts_start)); |