From: <hug...@li...> - 2011-05-27 18:29:58
|
branch: details: http://hugin.hg.sourceforge.net/hgweb/hugin/hugin/hgrepo/h/hu/hugin/hugin/rev/32055f79a8aa changeset: diffstat: src/hugin_base/algorithms/control_points/CleanCP.cpp | 7 +++++-- src/hugin_base/algorithms/control_points/CleanCP.h | 3 ++- src/tools/cpclean.cpp | 13 +++++++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diffs (82 lines): diff -r 2f64259cad1c -r 32055f79a8aa src/hugin_base/algorithms/control_points/CleanCP.cpp --- a/src/hugin_base/algorithms/control_points/CleanCP.cpp Fri May 27 20:01:08 2011 +0200 +++ b/src/hugin_base/algorithms/control_points/CleanCP.cpp Fri May 27 20:29:40 2011 +0200 @@ -112,10 +112,13 @@ return CPtoRemove; }; -UIntSet getCPoutsideLimit(Panorama pano, double n) +UIntSet getCPoutsideLimit(Panorama pano, double n,bool skipOptimisation) { UIntSet CPtoRemove; - SmartOptimise::smartOptimize(pano); + if(!skipOptimisation) + { + SmartOptimise::smartOptimize(pano); + }; CPVector allCP=pano.getCtrlPoints(); //remove all horizontal and vertical CP for calculation of mean and sigma CPVector CPxy; diff -r 2f64259cad1c -r 32055f79a8aa src/hugin_base/algorithms/control_points/CleanCP.h --- a/src/hugin_base/algorithms/control_points/CleanCP.h Fri May 27 20:01:08 2011 +0200 +++ b/src/hugin_base/algorithms/control_points/CleanCP.h Fri May 27 20:29:40 2011 +0200 @@ -46,8 +46,9 @@ /** optimises the whole panorama and removes all control points with error > mean+n*sigma @param pano panorama which should be used @param n determines, how big the deviation from mean should be to determine wrong control points, default 2.0 + @param skipOptimisation skips the optimisation step, the current position of the images is used @return set which contains control points with error > mean+n*sigma */ -IMPEX UIntSet getCPoutsideLimit(Panorama pano, double n=2.0); +IMPEX UIntSet getCPoutsideLimit(Panorama pano, double n=2.0, bool skipOptimisation=false); /** returns these control points, which are in masks */ IMPEX UIntSet getCPinMasks(Panorama pano); diff -r 2f64259cad1c -r 32055f79a8aa src/tools/cpclean.cpp --- a/src/tools/cpclean.cpp Fri May 27 20:01:08 2011 +0200 +++ b/src/tools/cpclean.cpp Fri May 27 20:29:40 2011 +0200 @@ -64,6 +64,7 @@ << " -n num distance factor for checking (default: 2)" << endl << " -p do only pairwise optimisation (skip step 2)" << endl << " -w do optimise whole panorama (skip step 1)" << endl + << " -s skip optimisation step when optimisation the whole panorama" << endl << " -h shows help" << endl << endl; } @@ -71,12 +72,13 @@ int main(int argc, char *argv[]) { // parse arguments - const char * optstring = "o:hn:pw"; + const char * optstring = "o:hn:pws"; int c; string output; bool onlyPair = false; bool wholePano = false; + bool skipOptimisation = false; double n = 2.0; while ((c = getopt (argc, argv, optstring)) != -1) { @@ -106,6 +108,9 @@ case 'w': wholePano = true; break; + case 's': + skipOptimisation = true; + break; case ':': cerr <<"Option -n requires a number" << endl; return 1; @@ -185,7 +190,11 @@ else { CPtoRemove.clear(); - CPtoRemove=getCPoutsideLimit(pano,n); + if(skipOptimisation) + { + std::cout << endl << "Skipping optimisation, current image positions will be used." << endl; + }; + CPtoRemove=getCPoutsideLimit(pano,n,skipOptimisation); if (CPtoRemove.size()>0) for(UIntSet::reverse_iterator it = CPtoRemove.rbegin(); it != CPtoRemove.rend(); ++it) pano.removeCtrlPoint(*it); |