From ca4c449ba9f3a40f8ac2c79a48f3d31144a1fafe Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sat, 16 Dec 2006 17:22:03 +0100 Subject: add command line option to specify distortion parameters --- src/gipfel.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index a746a2e..3f6bb08 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -204,6 +204,7 @@ void usage() { " This must be a string that unambiguously \n" " matches the name of an entry in the data file.\n" " -d Use for GPS data.\n" + " -u , Use distortion correction values k0,k1.\n" " -s Stitch mode.\n" " -w Width of result image.\n" " -h Height of result image.\n" @@ -325,12 +326,13 @@ int main(int argc, char** argv) { int stitch_flag = 0, stitch_w = 2000, stitch_h = 500; int jpeg_flag = 0, tiff_flag = 0; double stitch_from = 0.0, stitch_to = 380.0; + double dist_k0 = 0.0, dist_k1 = 0.0; char *outpath; Fl_Scroll *scroll; err = 0; - while ((c = getopt(argc, argv, ":?d:v:s:w:h:j:t:")) != EOF) { + while ((c = getopt(argc, argv, ":?d:v:s:w:h:j:t:u:")) != EOF) { switch (c) { case '?': usage(); @@ -351,6 +353,14 @@ int main(int argc, char** argv) { } } break; + case 'u': + if (optarg && strcmp(optarg, ":")) { + dist_k0 = atof(optarg); + if (strchr(optarg, ',')) { + dist_k1 = atof(strchr(optarg, ',') + 1); + } + } + break; case 'j': jpeg_flag++; outpath = optarg; @@ -419,6 +429,7 @@ int main(int argc, char** argv) { control_win->label(img_file); } + gipf->set_distortion_params(dist_k0, dist_k1); view_win->size(gipf->w(), gipf->h()); scroll->size(gipf->w(), gipf->h()); -- cgit v1.2.3