aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 204f77f..d51765c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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));