From 79b50125e9eb71cc8718784c4c5e7111c6a0e286 Mon Sep 17 00:00:00 2001 From: David Hilvert Date: Sun, 1 Jun 2008 18:01:36 +0000 Subject: [PATCH] d2::trans_multi: Add --mi option (useful for debugging multi-alignment with, e.g., --mi -100). --- d2/trans_multi.cc | 1 + d2/trans_multi.h | 9 +++++++-- ui/help.h | 1 + ui/input.cc | 2 ++ ui/input.h | 2 ++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/d2/trans_multi.cc b/d2/trans_multi.cc index fc97918..7bee0ed 100644 --- a/d2/trans_multi.cc +++ b/d2/trans_multi.cc @@ -24,3 +24,4 @@ */ ale_pos trans_multi::_multi_decomp = 100; +ale_pos trans_multi::_multi_improvement = 0; diff --git a/d2/trans_multi.h b/d2/trans_multi.h index a80a765..bfaeb3f 100644 --- a/d2/trans_multi.h +++ b/d2/trans_multi.h @@ -49,6 +49,7 @@ public: private: static ale_pos _multi_decomp; + static ale_real _multi_improvement; typedef unsigned int index_t; @@ -91,6 +92,10 @@ public: _multi_decomp = d; } + static void set_mi(double d) { + _multi_improvement = d; + } + /* * Calculate euclidean identity transform for a given image. */ @@ -478,7 +483,7 @@ public: ale_real diff1 = (pt * ip1 - rp).norm(); ale_real diff0 = (qt * ip0 - rp).norm(); - if (diff1 < diff0) + if (diff1 < diff0 * (1 - _multi_improvement)) spatio_elem_map[cur_ref_width * i + j] = index; } @@ -501,7 +506,7 @@ public: ale_real diff1 = (pt * ip1 - rp).norm(); ale_real diff0 = (ut * ip1 - rp0).norm(); - if (diff1 < diff0) + if (diff1 < diff0 * (1 - _multi_improvement)) spatio_elem_map_r[input_width * ii + jj] = index; } } diff --git a/ui/help.h b/ui/help.h index e0c09b1..6251ddb 100644 --- a/ui/help.h +++ b/ui/help.h @@ -256,6 +256,7 @@ public: HEADER_SPACE "--md Set element minimum dimension x; 0 disables. (100 is default)\n" "--ma-cert Set mean certainty lower bound. (0.01 is default)\n" + "--mi Require error improvement fraction . (0 is default)\n" "\n" ); } diff --git a/ui/input.cc b/ui/input.cc index 02483b0..2dea803 100644 --- a/ui/input.cc +++ b/ui/input.cc @@ -44,6 +44,7 @@ const char *input::supported_nonglobal_option_table[] = { "black", "md", "ma-cert", + "mi", NULL }; @@ -123,6 +124,7 @@ input::simple_option input::simple_option_table[] = { { "md", NULL, NULL, 1 }, { "ma-cert", NULL, NULL, 1 }, + { "mi", NULL, NULL, 1 }, { "focus", "error" }, diff --git a/ui/input.h b/ui/input.h index 2d0f5c2..9236394 100644 --- a/ui/input.h +++ b/ui/input.h @@ -2720,6 +2720,8 @@ public: d2::trans_multi::set_md(env->get_double_arg(i->first, 1)); } else if (!strcmp(option_name, "ma-cert")) { d2::align::set_ma_cert(env->get_double_arg(i->first, 1)); + } else if (!strcmp(option_name, "mi")) { + d2::trans_multi::set_mi(env->get_double_arg(i->first, 1)); } else if (!strcmp(option_name, "gs-mo")) { const char *option = env->get_string_arg(i->first, 1); double gs_mo; -- 2.11.4.GIT