add logging engine
add options to control harris algorithum
This commit is contained in:
29
argpopt.h
29
argpopt.h
@ -27,10 +27,15 @@ struct Config
|
||||
std::string norm = "";
|
||||
std::string maps = "";
|
||||
std::string bg = "";
|
||||
int blockSize = 5;
|
||||
int apature = 5;
|
||||
float detectorParameter = 0.01;
|
||||
float minSize = 7;
|
||||
bool verbose = false;
|
||||
bool quiet = false;
|
||||
};
|
||||
|
||||
const char *argp_program_version = "0.1";
|
||||
const char *argp_program_version = "0.2";
|
||||
const char *argp_program_bug_address = "<carl@uvos.xyz>";
|
||||
static char doc[] = "Program to determine the lubricant thikness on a curved surface";
|
||||
static char args_doc[] = "";
|
||||
@ -38,9 +43,14 @@ static char args_doc[] = "";
|
||||
static struct argp_option options[] =
|
||||
{
|
||||
{"verbose", 'v', 0, 0, "Enable verbose logging" },
|
||||
{"quiet", 'q', 0, 0, "Disable info messages" },
|
||||
{"map", 'm', "File Name", 0, "remap maps file" },
|
||||
{"bg", 'b', "File Name", 0, "background image file" },
|
||||
{"normalize", 'n', "File Name", 0, "image to use as a normalization source" },
|
||||
{"apature", 'a', "Value", 0, "Sobel size" },
|
||||
{"block-size", 't', "Value", 0, "Harris neighborhood size " },
|
||||
{"detector-arameter", 'd', "Value", 0, "Harris detector parameter" },
|
||||
{"min-size", 's', "Value", 0, "Smallest feature accepted as a corner" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
@ -53,6 +63,9 @@ error_t parse_opt (int key, char *arg, struct argp_state *state)
|
||||
case 'v':
|
||||
config->verbose = true;
|
||||
break;
|
||||
case 'q':
|
||||
config->quiet = true;
|
||||
break;
|
||||
case 'm':
|
||||
config->maps.assign(arg);
|
||||
break;
|
||||
@ -62,6 +75,20 @@ error_t parse_opt (int key, char *arg, struct argp_state *state)
|
||||
case 'n':
|
||||
config->norm.assign(arg);
|
||||
break;
|
||||
case 'a':
|
||||
config->apature=atol(arg);
|
||||
if(config->apature % 2 == 0) ++config->apature;
|
||||
break;
|
||||
case 't':
|
||||
config->blockSize=atol(arg);
|
||||
if(config->blockSize % 2 == 0) ++config->blockSize;
|
||||
break;
|
||||
case 'd':
|
||||
config->detectorParameter=atol(arg);
|
||||
break;
|
||||
case 's':
|
||||
config->minSize=atol(arg);
|
||||
break;
|
||||
case ARGP_KEY_NO_ARGS:
|
||||
argp_usage(state);
|
||||
case ARGP_KEY_ARG:
|
||||
|
Reference in New Issue
Block a user