From: <hug...@li...> - 2011-09-15 19:47:43
|
branch: details: http://hugin.hg.sourceforge.net/hgweb/hugin/hugin/hgrepo/h/hu/hugin/hugin/rev/906d3ea743c9 changeset: 5573:906d3ea743c9 user: tmodes date: Thu Sep 15 21:45:44 2011 +0200 description: Make running linefind in assistant optional diffstat: src/hugin1/base_wx/RunStitchPanel.cpp | 3 +- src/hugin1/hugin/AssistantPanel.cpp | 3 +- src/hugin1/hugin/PreferencesDialog.cpp | 4 + src/hugin1/hugin/config_defaults.h | 1 + src/hugin1/hugin/xrc/pref_dialog.xrc | 10 +++- src/hugin_base/algorithms/assistant_makefile/AssistantMakefilelibExport.cpp | 23 +++++---- src/hugin_base/algorithms/assistant_makefile/AssistantMakefilelibExport.h | 7 ++- 7 files changed, 36 insertions(+), 15 deletions(-) diffs (187 lines): diff -r a7863c364ae9 -r 906d3ea743c9 src/hugin1/base_wx/RunStitchPanel.cpp --- a/src/hugin1/base_wx/RunStitchPanel.cpp Thu Sep 15 17:18:49 2011 +0200 +++ b/src/hugin1/base_wx/RunStitchPanel.cpp Thu Sep 15 21:45:44 2011 +0200 @@ -323,6 +323,7 @@ double celesteThreshold; config.Read(wxT("/Celeste/Threshold"), &celesteThreshold, HUGIN_CELESTE_THRESHOLD); bool celesteSmall=config.Read(wxT("/Celeste/Filter"), HUGIN_CELESTE_FILTER)!=0; + bool runLinefind=config.Read(wxT("/Assistant/Linefind"), HUGIN_ASS_LINEFIND)!=0; bool runCPClean=config.Read(wxT("/Assistant/AutoCPClean"), HUGIN_ASS_AUTO_CPCLEAN)!=0; double scale; config.Read(wxT("/Assistant/panoDownsizeFactor"), &scale, HUGIN_ASS_PANO_DOWNSIZE_FACTOR); @@ -343,7 +344,7 @@ std::ofstream makefile(m_currentMakefn.mb_str(HUGIN_CONV_FILENAME)); makefile.exceptions( std::ofstream::eofbit | std::ofstream::failbit | std::ofstream::badbit ); std::string scriptString(scriptFile.mb_str(HUGIN_CONV_FILENAME)); - HuginBase::AssistantMakefilelibExport::createMakefile(pano,progs,runCeleste,celesteThreshold,celesteSmall, + HuginBase::AssistantMakefilelibExport::createMakefile(pano,progs,runLinefind,runCeleste,celesteThreshold,celesteSmall, runCPClean,scale,makefile,scriptString); makefile.close(); diff -r a7863c364ae9 -r 906d3ea743c9 src/hugin1/hugin/AssistantPanel.cpp --- a/src/hugin1/hugin/AssistantPanel.cpp Thu Sep 15 17:18:49 2011 +0200 +++ b/src/hugin1/hugin/AssistantPanel.cpp Thu Sep 15 21:45:44 2011 +0200 @@ -376,6 +376,7 @@ double celesteThreshold; config->Read(wxT("/Celeste/Threshold"), &celesteThreshold, HUGIN_CELESTE_THRESHOLD); bool celesteSmall=config->Read(wxT("/Celeste/Filter"), HUGIN_CELESTE_FILTER)==0; + bool runLinefind=config->Read(wxT("/Assistant/Linefind"), HUGIN_ASS_LINEFIND)!=0; bool runCPClean=config->Read(wxT("/Assistant/AutoCPClean"), HUGIN_ASS_AUTO_CPCLEAN)!=0; double scale; config->Read(wxT("/Assistant/panoDownsizeFactor"), &scale, HUGIN_ASS_PANO_DOWNSIZE_FACTOR); @@ -398,7 +399,7 @@ std::ofstream makefile(makefileName.mb_str(HUGIN_CONV_FILENAME)); makefile.exceptions( std::ofstream::eofbit | std::ofstream::failbit | std::ofstream::badbit ); std::string scriptString(scriptName.mb_str(HUGIN_CONV_FILENAME)); - HuginBase::AssistantMakefilelibExport::createMakefile(*m_pano,progs,runCeleste,celesteThreshold,celesteSmall, + HuginBase::AssistantMakefilelibExport::createMakefile(*m_pano,progs,runLinefind,runCeleste,celesteThreshold,celesteSmall, runCPClean,scale,makefile,scriptString); makefile.close(); diff -r a7863c364ae9 -r 906d3ea743c9 src/hugin1/hugin/PreferencesDialog.cpp --- a/src/hugin1/hugin/PreferencesDialog.cpp Thu Sep 15 17:18:49 2011 +0200 +++ b/src/hugin1/hugin/PreferencesDialog.cpp Thu Sep 15 21:45:44 2011 +0200 @@ -489,6 +489,8 @@ MY_STR_VAL("prefs_ass_editor_args", cfg->Read(wxT("/Stitcher/EditorArgs"), wxT(HUGIN_STITCHER_EDITOR_ARGS))); MY_CHOICE_VAL("prefs_ass_preview", cfg->Read(wxT("/Assistant/PreviewWindow"), HUGIN_ASS_PREVIEW)); + t = cfg->Read(wxT("/Assistant/Linefind"), HUGIN_ASS_LINEFIND) == 1; + MY_BOOL_VAL("prefs_ass_linefind", t); t = cfg->Read(wxT("/Celeste/Auto"), HUGIN_CELESTE_AUTO) == 1; MY_BOOL_VAL("prefs_celeste_auto", t); t = cfg->Read(wxT("/Assistant/AutoCPClean"), HUGIN_ASS_AUTO_CPCLEAN) == 1; @@ -683,6 +685,7 @@ cfg->Write(wxT("/Stitcher/Editor"), wxT(HUGIN_STITCHER_EDITOR)); cfg->Write(wxT("/Stitcher/EditorArgs"), wxT(HUGIN_STITCHER_EDITOR_ARGS)); cfg->Write(wxT("/Assistant/PreviewWindow"), HUGIN_ASS_PREVIEW); + cfg->Write(wxT("/Assistant/Linefind"), HUGIN_ASS_LINEFIND); cfg->Write(wxT("/Celeste/Auto"), HUGIN_CELESTE_AUTO); cfg->Write(wxT("/Assistant/AutoCPClean"), HUGIN_ASS_AUTO_CPCLEAN); } @@ -770,6 +773,7 @@ cfg->Write(wxT("/Assistant/nControlPoints"), MY_G_SPIN_VAL("prefs_ass_nControlPoints")); cfg->Write(wxT("/Assistant/panoDownsizeFactor"), MY_G_SPIN_VAL("prefs_ass_panoDownsizeFactor") / 100.0); cfg->Write(wxT("/Assistant/PreviewWindow"), MY_G_CHOICE_VAL("prefs_ass_preview")); + cfg->Write(wxT("/Assistant/Linefind"), MY_G_BOOL_VAL("prefs_ass_linefind")); cfg->Write(wxT("/Celeste/Auto"), MY_G_BOOL_VAL("prefs_celeste_auto")); cfg->Write(wxT("/Assistant/AutoCPClean"), MY_G_BOOL_VAL("prefs_auto_cpclean")); // editor diff -r a7863c364ae9 -r 906d3ea743c9 src/hugin1/hugin/config_defaults.h --- a/src/hugin1/hugin/config_defaults.h Thu Sep 15 17:18:49 2011 +0200 +++ b/src/hugin1/hugin/config_defaults.h Thu Sep 15 21:45:44 2011 +0200 @@ -33,6 +33,7 @@ #define HUGIN_ASS_AUTO_ALIGN 0l #define HUGIN_ASS_OPT_PHOTOMETRIC 1l #define HUGIN_ASS_AUTO_CPCLEAN 1l +#define HUGIN_ASS_LINEFIND 1l #define HUGIN_ASS_PREVIEW 1l // celeste panel diff -r a7863c364ae9 -r 906d3ea743c9 src/hugin1/hugin/xrc/pref_dialog.xrc --- a/src/hugin1/hugin/xrc/pref_dialog.xrc Thu Sep 15 17:18:49 2011 +0200 +++ b/src/hugin1/hugin/xrc/pref_dialog.xrc Thu Sep 15 21:45:44 2011 +0200 @@ -241,6 +241,14 @@ <object class="sizeritem"> <object class="wxStaticBoxSizer"> <object class="sizeritem"> + <object class="wxCheckBox" name="prefs_ass_linefind"> + <label>Detect vertical lines</label> + <tooltip>Detects vertical lines in the images to level the pano</tooltip> + </object> + <flag>wxALL</flag> + <border>5</border> + </object> + <object class="sizeritem"> <object class="wxCheckBox" name="prefs_celeste_auto"> <label>Remove cloud-like control points (Celeste)</label> </object> @@ -254,7 +262,7 @@ <flag>wxALL</flag> <border>5</border> </object> - <label>Automatic control point checking after detecting control points</label> + <label>Optional assistant steps</label> <orient>wxVERTICAL</orient> </object> <flag>wxALL|wxEXPAND</flag> diff -r a7863c364ae9 -r 906d3ea743c9 src/hugin_base/algorithms/assistant_makefile/AssistantMakefilelibExport.cpp --- a/src/hugin_base/algorithms/assistant_makefile/AssistantMakefilelibExport.cpp Thu Sep 15 17:18:49 2011 +0200 +++ b/src/hugin_base/algorithms/assistant_makefile/AssistantMakefilelibExport.cpp Thu Sep 15 21:45:44 2011 +0200 @@ -140,19 +140,22 @@ }; }; //vertical line detector - CPVector allCP=pano.getCtrlPoints(); - bool hasVerticalLines=false; - if(allCP.size()>0) + if(runLinefind) { - for(size_t i=0;i<allCP.size() && !hasVerticalLines;i++) + CPVector allCP=pano.getCtrlPoints(); + bool hasVerticalLines=false; + if(allCP.size()>0) { - hasVerticalLines=(allCP[i].mode==ControlPoint::X); + for(size_t i=0;i<allCP.size() && !hasVerticalLines;i++) + { + hasVerticalLines=(allCP[i].mode==ControlPoint::X); + }; }; - }; - if(!hasVerticalLines) - { - echoInfo(*all,"Searching for vertical lines..."); - all->addCommand(vlinefind->getRef()+outinproject); + if(!hasVerticalLines) + { + echoInfo(*all,"Searching for vertical lines..."); + all->addCommand(vlinefind->getRef()+outinproject); + }; }; //now optimise all all->addCommand(vcheckpto->getRef()+" "+vprojectShell->getRef()); diff -r a7863c364ae9 -r 906d3ea743c9 src/hugin_base/algorithms/assistant_makefile/AssistantMakefilelibExport.h --- a/src/hugin_base/algorithms/assistant_makefile/AssistantMakefilelibExport.h Thu Sep 15 17:18:49 2011 +0200 +++ b/src/hugin_base/algorithms/assistant_makefile/AssistantMakefilelibExport.h Thu Sep 15 21:45:44 2011 +0200 @@ -71,6 +71,7 @@ std::ostream & makefile; const std::string& projectFile; const AssistantPrograms &progs; + const bool &runLinefind; const bool &runCeleste; const double &celesteThreshold; const bool &celesteSmallRadius; @@ -89,6 +90,7 @@ public: AssistantMakefilelibExport(PanoramaData & pano_, const AssistantPrograms & progs_, + const bool &runLinefind_, const bool &runCeleste_, const double &celesteThreshold_, const bool &celesteSmallRadius_, @@ -97,7 +99,7 @@ std::ostream & makefile_, const std::string& projectFile_) : PanoramaAlgorithm(pano_), - pano(pano_), progs(progs_), + pano(pano_), progs(progs_), runLinefind(runLinefind_), runCeleste(runCeleste_), celesteThreshold(celesteThreshold_), celesteSmallRadius(celesteSmallRadius_), runCPClean(runCPClean_), scale(scale_), makefile(makefile_), projectFile(projectFile_) { @@ -106,6 +108,7 @@ static void createMakefile(PanoramaData & pano_, const AssistantPrograms & progs_, + const bool &runLinefind_, const bool &runCeleste_, const double &celesteThreshold_, const bool &celesteSmallRadius_, @@ -115,7 +118,7 @@ const std::string& projectFile_) { AssistantMakefilelibExport* instance = new AssistantMakefilelibExport( - pano_, progs_, runCeleste_, celesteThreshold_, celesteSmallRadius_, + pano_, progs_, runLinefind_, runCeleste_, celesteThreshold_, celesteSmallRadius_, runCPClean_, scale_, makefile_, projectFile_); instance->createItems(); instance->writeMakefile(); |