From: <bl...@us...> - 2008-10-23 13:23:42
|
Revision: 3516 http://hugin.svn.sourceforge.net/hugin/?rev=3516&view=rev Author: blimbo Date: 2008-10-23 12:31:23 +0000 (Thu, 23 Oct 2008) Log Message: ----------- More debugging code for Celeste/Windows Modified Paths: -------------- hugin/trunk/src/PTBatcher/Batch.cpp hugin/trunk/src/celeste/Celeste.cpp hugin/trunk/src/hugin1/hugin/CPEditorPanel.cpp Modified: hugin/trunk/src/PTBatcher/Batch.cpp =================================================================== --- hugin/trunk/src/PTBatcher/Batch.cpp 2008-10-22 20:13:12 UTC (rev 3515) +++ hugin/trunk/src/PTBatcher/Batch.cpp 2008-10-23 12:31:23 UTC (rev 3516) @@ -368,7 +368,8 @@ "-------------------------------------" << endl; for(unsigned int i=0; i<m_projList.GetCount(); i++) { - cout << m_projList.Item(i).id << " " << m_projList.Item(i).path.char_str() << " " << m_projList.Item(i).prefix.char_str() << " " << m_projList.Item(i).GetStatusText().char_str() << endl; + cout << m_projList.Item(i).id << " " << (const char*)m_projList.Item(i).path.char_str() << " " << (const char*)m_projList.Item(i).prefix.char_str() + << " " << (const char*)m_projList.Item(i).GetStatusText().char_str() << endl; } } } @@ -717,7 +718,7 @@ if(gui) wxMessageBox( _T("Error: Could not delete project file ")+file.GetFullPath(),_T("Error!"),wxOK | wxICON_INFORMATION ); else if(verbose) - cout << "Error: Could not delete project file " << file.GetFullPath().char_str() << endl; + cout << "Error: Could not delete project file " << (const char*)file.GetFullPath().char_str() << endl; } } } @@ -785,7 +786,7 @@ if(gui) SetStatusText(_T("Running command \"")+m_projList.Item(i).path+_T("\"")); else - cout << "Running command \"" << m_projList.Item(i).path.char_str() << "\"" << endl; + cout << "Running command \"" << (const char*)m_projList.Item(i).path.char_str() << "\"" << endl; m_projList.Item(i).status=Project::RUNNING; if(!gui) //we create a fake stitchFrame, so program waits for app to complete { Modified: hugin/trunk/src/celeste/Celeste.cpp =================================================================== --- hugin/trunk/src/celeste/Celeste.cpp 2008-10-22 20:13:12 UTC (rev 3515) +++ hugin/trunk/src/celeste/Celeste.cpp 2008-10-23 12:31:23 UTC (rev 3516) @@ -43,7 +43,7 @@ mask_format,vector<double>& svm_responses){ // Windows debug stuff - freopen ("celeste.log","a",stdout); + //freopen ("celeste.log","a",stdout); // Open SVM model file struct svm_model* model; @@ -543,6 +543,6 @@ svm_destroy_model(model); // Windows debug end - fclose (stdout); + //fclose (stdout); } Modified: hugin/trunk/src/hugin1/hugin/CPEditorPanel.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/CPEditorPanel.cpp 2008-10-22 20:13:12 UTC (rev 3515) +++ hugin/trunk/src/hugin1/hugin/CPEditorPanel.cpp 2008-10-23 12:31:23 UTC (rev 3516) @@ -2124,6 +2124,9 @@ // Windows debug stuff freopen ("celeste.log","a",stdout); + + // Windows debug end + cout << "Celeste: Setting locale" << endl; // set numeric locale to C, for correct number output char * old_locale = setlocale(LC_NUMERIC,NULL); @@ -2131,6 +2134,9 @@ MainFrame::Get()->SetStatusText(_("searching for cloud-like control points..."),0); + // Windows debug + cout << "Celeste: Creating storage matrix" << endl; + // Create the storage matrix gNumLocs = currentPoints.size(); gLocations = CreateMatrix( (int)0, gNumLocs, 2); @@ -2139,11 +2145,15 @@ unsigned int glocation_counter = 0; for (vector<CPoint>::const_iterator it = currentPoints.begin(); it != currentPoints.end(); ++it) { - //cerr << "---Celeste--- CP x,y: " << it->second.x1 << "," << it->second.y1 << endl; + // Windows debug + cout << "Celeste: Loading CP into matrix - x,y: " << it->second.x1 << "," << it->second.y1 << endl; gLocations[glocation_counter][0] = (int)it->second.x1; gLocations[glocation_counter][1] = (int)it->second.y1; glocation_counter++; } + + // Windows debug + cout << "Celeste: Storage matrix filled" << endl; // Get Celeste paramaters wxConfigBase *cfg = wxConfigBase::Get(); @@ -2171,6 +2181,9 @@ strcat( buf, HUGIN_CELESTE_MODEL); string modelfile = buf; + // Windows debug + cout << "Celeste: Checking model file exists" << endl; + // SVM model file if (! wxFile::Exists(wxString::FromAscii(buf)) ) { wxMessageBox(_("Celeste model file not found, Hugin needs to be properly installed." ), _("Fatal Error")); @@ -2182,25 +2195,35 @@ DEBUG_TRACE("Running Celeste"); cout << "Running Celeste" << endl; - - // Windows debug end - fclose (stdout); - + // Get responses bool verbose = true; string mask_format = "PNG"; unsigned int mask = 0; + + // Windows debug + cout << "Celeste: Running get_gabor_response function" << endl; + + // Windows debug end + //fclose (stdout); + get_gabor_response(imagefile,mask,modelfile,threshold,mask_format,svm_responses); // Windows debug stuff - freopen ("celeste.log","a",stdout); + //freopen ("celeste.log","a",stdout); + // Windows debug + cout << "Celeste: Finished running get_gabor_response function" << endl; + // Print SVM results unsigned int removed = 0; for (unsigned int c = 0; c < svm_responses.size(); c++){ if (svm_responses[c] >= threshold){ + // Windows debug + cout << "Celeste: Removing CPs" << endl; + unsigned int pNr = localPNr2GlobalPNr((c - removed)); DEBUG_DEBUG("about to delete point " << pNr); GlobalCmdHist::getInstance().addCommand( @@ -2212,6 +2235,9 @@ if (removed) cout << endl; } + // Windows debug + cout << "Celeste: Finished removing CPs" << endl; + wxMessageBox(wxString::Format(_("Finished running Celeste.\n%d cloud-like control points removed."), removed), _("Celeste"), wxICON_EXCLAMATION, this); @@ -2219,6 +2245,9 @@ MainFrame::Get()->SetStatusText(_(""),0); + // Windows debug + cout << "Celeste: Resetting locale" << endl; + // reset locale setlocale(LC_NUMERIC,old_locale); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |