From: <da...@us...> - 2008-02-11 21:52:55
|
Revision: 2822 http://hugin.svn.sourceforge.net/hugin/?rev=2822&view=rev Author: dangelo Date: 2008-02-11 13:52:52 -0800 (Mon, 11 Feb 2008) Log Message: ----------- Added new autopano options: %v approximate field of view in degrees %t panotools image projection format, 0-4 Modified Paths: -------------- hugin/trunk/src/hugin1/hugin/AutoCtrlPointCreator.cpp Modified: hugin/trunk/src/hugin1/hugin/AutoCtrlPointCreator.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/AutoCtrlPointCreator.cpp 2008-02-10 21:15:16 UTC (rev 2821) +++ hugin/trunk/src/hugin1/hugin/AutoCtrlPointCreator.cpp 2008-02-11 21:52:52 UTC (rev 2822) @@ -93,8 +93,8 @@ CPVector AutoCtrlPointCreator::automatch(Panorama & pano, - const UIntSet & imgs, - int nFeatures) + const UIntSet & imgs, + int nFeatures) { CPVector cps; int t = wxConfigBase::Get()->Read(wxT("/AutoPano/Type"),HUGIN_AP_TYPE); @@ -150,6 +150,9 @@ int nFeatures) { CPVector cps; + if (imgs.size() == 0) { + return cps; + } // create suitable command line.. #ifdef __WXMSW__ @@ -174,12 +177,12 @@ if (autopanoExe == wxT(HUGIN_APSIFT_EXE)) { autopanoExe = MacGetPathToBundledResourceFile(CFSTR("autopano-complete-mac.sh")); - + //if the script exists inside the bundle (which should), then check if there is autopano-sift files inside bundle: if(autopanoExe != wxT("")) { wxString autopanoExeDir = MacGetPathToBundledResourceFile(CFSTR("autopano-sift")); - + //if they are not in bundle, then do not use the script included in the bundle if( autopanoExeDir == wxT("") || !wxFileExists(autopanoExeDir+wxT("/autopano.exe")) @@ -212,12 +215,12 @@ wxT(HUGIN_APSIFT_ARGS)); #ifdef __WXMSW__ - // remember cwd. - wxString cwd = wxGetCwd(); - wxString apDir = wxPathOnly(autopanoExe); - if (apDir.Length() > 0) { - wxSetWorkingDirectory(apDir); - } + // remember cwd. + wxString cwd = wxGetCwd(); + wxString apDir = wxPathOnly(autopanoExe); + if (apDir.Length() > 0) { + wxSetWorkingDirectory(apDir); + } #endif // TODO: create a secure temporary filename here @@ -227,6 +230,13 @@ tmp.Printf(wxT("%d"), nFeatures); autopanoArgs.Replace(wxT("%p"), tmp); + SrcPanoImage firstImg = pano.getSrcImage(*imgs.begin()); + tmp.Printf(wxT("%f"), firstImg.getHFOV()); + autopanoArgs.Replace(wxT("%v"), tmp); + + tmp.Printf(wxT("%d"), (int) firstImg.getProjection()); + autopanoArgs.Replace(wxT("%t"), tmp); + // build a list of all image files, and a corrosponding connection map. // local img nr -> global (panorama) img number std::map<int,int> imgMapping; @@ -382,6 +392,13 @@ wxString tmp; tmp.Printf(wxT("%d"), nFeatures); autopanoArgs.Replace(wxT("%p"), tmp); + SrcPanoImage firstImg = pano.getSrcImage(*imgs.begin()); + tmp.Printf(wxT("%f"), firstImg.getHFOV()); + autopanoArgs.Replace(wxT("%v"), tmp); + + tmp.Printf(wxT("%d"), (int) firstImg.getProjection()); + autopanoArgs.Replace(wxT("%t"), tmp); + autopanoArgs.Replace(wxT("%i"), wxString (imgFiles.c_str(), *wxConvCurrent)); wxString tempdir = ptofn.GetPath(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |