From: <bl...@us...> - 2008-09-09 01:09:34
|
Revision: 3407 http://hugin.svn.sourceforge.net/hugin/?rev=3407&view=rev Author: blimbo Date: 2008-09-09 01:09:30 +0000 (Tue, 09 Sep 2008) Log Message: ----------- Celeste integration: error box if model not found. default model path still needs to be fixed Modified Paths: -------------- hugin/branches/gsoc2008_sky_identification/CMakeLists.txt hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/DependInfo.cmake hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/build.make hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/cmake_clean.cmake hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/flags.make hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/link.txt hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/progress.make hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/progress.make hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeLists.txt hugin/branches/gsoc2008_sky_identification/src/celeste/cmake_install.cmake hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/AssistantPanel.cpp hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/CPEditorPanel.cpp hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/PreferencesDialog.cpp hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/config_defaults.h Modified: hugin/branches/gsoc2008_sky_identification/CMakeLists.txt =================================================================== --- hugin/branches/gsoc2008_sky_identification/CMakeLists.txt 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/CMakeLists.txt 2008-09-09 01:09:30 UTC (rev 3407) @@ -169,60 +169,6 @@ #INCLUDE_DIRECTORIES( ${VIPSCC_INCLUDE_DIRS} ) #LINK_DIRECTORIES( ${VIPSCC_LIBRARY_DIRS} ) - -## -## Celeste -## - -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/src/celeste) - -## -## Find TINYSVM -## - -FIND_PATH(TINYSVM_INCLUDE_DIR tinysvm.h /usr/local/include REQUIRED) -FIND_LIBRARY(TINYSVM_LIBRARY NAMES tinysvm PATH /usr/lib /usr/local/lib REQUIRED) - -IF (TINYSVM_INCLUDE_DIR AND TINYSVM_LIBRARY) - SET(TINYSVM_FOUND TRUE) -ENDIF (TINYSVM_INCLUDE_DIR AND TINYSVM_LIBRARY) - -IF (TINYSVM_FOUND) - IF (NOT TINYSVM_FIND_QUIETLY) - MESSAGE(STATUS "Found TINYSVM: ${TINYSVM_LIBRARY}") - ENDIF (NOT TINYSVM_FIND_QUIETLY) -ELSE (TINYSVM_FOUND) - IF (TINYSVM_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find TINYSVM") - ENDIF (TINYSVM_FIND_REQUIRED) -ENDIF (TINYSVM_FOUND) - -## -## Find VIGRA -## - -FIND_PATH(VIGRA_INCLUDE_DIR impex.hxx /usr/include/vigra REQUIRED) -FIND_LIBRARY(VIGRA_LIBRARY NAMES vigraimpex PATH /usr/lib /usr/local/lib REQUIRED) - -IF (VIGRA_INCLUDE_DIR AND VIGRA_LIBRARY) - SET(VIGRA_FOUND TRUE) -ENDIF (VIGRA_INCLUDE_DIR AND VIGRA_LIBRARY) - -IF (VIGRA_FOUND) - IF (NOT VIGRA_FIND_QUIETLY) - MESSAGE(STATUS "Found VIGRA: ${VIGRA_LIBRARY}") - ENDIF (NOT VIGRA_FIND_QUIETLY) -ELSE (VIGRA_FOUND) - IF (VIGRA_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find VIGRA") - ENDIF (VIGRA_FIND_REQUIRED) -ENDIF (VIGRA_FOUND) - -## End Celeste - - - - # # Check build type and set options accordingly # @@ -344,6 +290,57 @@ # install enfuse droplets and windows installer and everything else in platforms ADD_SUBDIRECTORY(platforms) + + +## +## Celeste +## +## Find TINYSVM +## + +FIND_PATH(TINYSVM_INCLUDE_DIR tinysvm.h /usr/local/include REQUIRED) +FIND_LIBRARY(TINYSVM_LIBRARY NAMES tinysvm PATH /usr/lib /usr/local/lib REQUIRED) + +IF (TINYSVM_INCLUDE_DIR AND TINYSVM_LIBRARY) + SET(TINYSVM_FOUND TRUE) +ENDIF (TINYSVM_INCLUDE_DIR AND TINYSVM_LIBRARY) + +IF (TINYSVM_FOUND) + IF (NOT TINYSVM_FIND_QUIETLY) + MESSAGE(STATUS "Found TINYSVM: ${TINYSVM_LIBRARY}") + ENDIF (NOT TINYSVM_FIND_QUIETLY) +ELSE (TINYSVM_FOUND) + IF (TINYSVM_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find TINYSVM") + ENDIF (TINYSVM_FIND_REQUIRED) +ENDIF (TINYSVM_FOUND) + +## +## Find VIGRA +## + +FIND_PATH(VIGRA_INCLUDE_DIR impex.hxx /usr/include/vigra REQUIRED) +FIND_LIBRARY(VIGRA_LIBRARY NAMES vigraimpex PATH /usr/lib /usr/local/lib REQUIRED) + +IF (VIGRA_INCLUDE_DIR AND VIGRA_LIBRARY) + SET(VIGRA_FOUND TRUE) +ENDIF (VIGRA_INCLUDE_DIR AND VIGRA_LIBRARY) + +IF (VIGRA_FOUND) + IF (NOT VIGRA_FIND_QUIETLY) + MESSAGE(STATUS "Found VIGRA: ${VIGRA_LIBRARY}") + ENDIF (NOT VIGRA_FIND_QUIETLY) +ELSE (VIGRA_FOUND) + IF (VIGRA_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find VIGRA") + ENDIF (VIGRA_FIND_REQUIRED) +ENDIF (VIGRA_FOUND) + +ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/src/celeste) + +## End Celeste + + SET(CPACK_PACKAGE_VERSION_MAJOR "${V_MAJOR}") SET(CPACK_PACKAGE_VERSION_MINOR "${V_MINOR}") SET(CPACK_PACKAGE_VERSION_PATCH "${V_PATCH}") Modified: hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/DependInfo.cmake =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/DependInfo.cmake 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/DependInfo.cmake 2008-09-09 01:09:30 UTC (rev 3407) @@ -17,6 +17,12 @@ ) SET(CMAKE_CXX_COMPILER_ID "GNU") +# Pairs of files generated by the same build rule. +SET(CMAKE_MULTIPLE_OUTPUT_PAIRS + "/home/tnugent/celeste_gsoc_svn/src/celeste/libceleste.so" "/home/tnugent/celeste_gsoc_svn/src/celeste/libceleste.so.0.0" + ) + + # Targets to which this target links. SET(CMAKE_TARGET_LINKED_INFO_FILES ) Modified: hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/build.make =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/build.make 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/build.make 2008-09-09 01:09:30 UTC (rev 3407) @@ -305,24 +305,26 @@ # External object files for target celeste celeste_EXTERNAL_OBJECTS = -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/Celeste.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/CelesteGlobals.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/ContrastFilter.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/Gabor.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/GaborFilter.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/GaborJet.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/ImageFile.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/LogPolar.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/PGMImage.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/Utilities.o -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/build.make -src/celeste/libceleste.a: src/celeste/CMakeFiles/celeste.dir/link.txt - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold "Linking CXX static library libceleste.a" - cd /home/tnugent/celeste_gsoc_svn/src/celeste && $(CMAKE_COMMAND) -P CMakeFiles/celeste.dir/cmake_clean_target.cmake +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/Celeste.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/CelesteGlobals.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/ContrastFilter.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/Gabor.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/GaborFilter.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/GaborJet.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/ImageFile.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/LogPolar.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/PGMImage.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/Utilities.o +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/build.make +src/celeste/libceleste.so.0.0: src/celeste/CMakeFiles/celeste.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold "Linking CXX shared library libceleste.so" cd /home/tnugent/celeste_gsoc_svn/src/celeste && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/celeste.dir/link.txt --verbose=$(VERBOSE) + cd /home/tnugent/celeste_gsoc_svn/src/celeste && $(CMAKE_COMMAND) -E cmake_symlink_library libceleste.so.0.0 libceleste.so.0.0 libceleste.so +src/celeste/libceleste.so: src/celeste/libceleste.so.0.0 + # Rule to build all files generated by this target. -src/celeste/CMakeFiles/celeste.dir/build: src/celeste/libceleste.a +src/celeste/CMakeFiles/celeste.dir/build: src/celeste/libceleste.so .PHONY : src/celeste/CMakeFiles/celeste.dir/build src/celeste/CMakeFiles/celeste.dir/requires: src/celeste/CMakeFiles/celeste.dir/Celeste.o.requires Modified: hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/cmake_clean.cmake =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/cmake_clean.cmake 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/cmake_clean.cmake 2008-09-09 01:09:30 UTC (rev 3407) @@ -11,6 +11,7 @@ "CMakeFiles/celeste.dir/Utilities.o" "libceleste.pdb" "libceleste.a" +"libceleste.so.0.0" "libceleste.so" ) Modified: hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/flags.make =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/flags.make 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/flags.make 2008-09-09 01:09:30 UTC (rev 3407) @@ -2,7 +2,7 @@ # Generated by "Unix Makefiles" Generator, CMake Version 2.6 # compile CXX with /usr/bin/c++ -CXX_FLAGS = -g -I/home/tnugent/celeste_gsoc_svn/src -I/home/tnugent/celeste_gsoc_svn/src/hugin_base -I/home/tnugent/celeste_gsoc_svn/src/foreign -I/home/tnugent/celeste_gsoc_svn/src/foreign/vigra -I/home/tnugent/celeste_gsoc_svn/src/celeste -I/usr/include/OpenEXR -I/usr/local/include +CXX_FLAGS = -Dceleste_EXPORTS -O3 -DNDEBUG -fPIC -I/home/tnugent/celeste_gsoc_svn/src -I/home/tnugent/celeste_gsoc_svn/src/hugin_base -I/home/tnugent/celeste_gsoc_svn/src/foreign -I/home/tnugent/celeste_gsoc_svn/src/foreign/vigra -I/home/tnugent/celeste_gsoc_svn/src/celeste -I/usr/include/OpenEXR -I/usr/local/include CXX_DEFINES = Modified: hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/link.txt =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/link.txt 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/link.txt 2008-09-09 01:09:30 UTC (rev 3407) @@ -1,2 +1 @@ -/usr/bin/ar cr libceleste.a CMakeFiles/celeste.dir/Celeste.o CMakeFiles/celeste.dir/CelesteGlobals.o CMakeFiles/celeste.dir/ContrastFilter.o CMakeFiles/celeste.dir/Gabor.o CMakeFiles/celeste.dir/GaborFilter.o CMakeFiles/celeste.dir/GaborJet.o CMakeFiles/celeste.dir/ImageFile.o CMakeFiles/celeste.dir/LogPolar.o CMakeFiles/celeste.dir/PGMImage.o CMakeFiles/celeste.dir/Utilities.o -/usr/bin/ranlib libceleste.a +/usr/bin/c++ -fPIC -O3 -DNDEBUG -shared -Wl,-soname,libceleste.so.0.0 -o libceleste.so.0.0 CMakeFiles/celeste.dir/Celeste.o CMakeFiles/celeste.dir/CelesteGlobals.o CMakeFiles/celeste.dir/ContrastFilter.o CMakeFiles/celeste.dir/Gabor.o CMakeFiles/celeste.dir/GaborFilter.o CMakeFiles/celeste.dir/GaborJet.o CMakeFiles/celeste.dir/ImageFile.o CMakeFiles/celeste.dir/LogPolar.o CMakeFiles/celeste.dir/PGMImage.o CMakeFiles/celeste.dir/Utilities.o Modified: hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/progress.make =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/progress.make 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/celeste.dir/progress.make 2008-09-09 01:09:30 UTC (rev 3407) @@ -1,11 +1,11 @@ -CMAKE_PROGRESS_1 = -CMAKE_PROGRESS_2 = 1 +CMAKE_PROGRESS_1 = 94 +CMAKE_PROGRESS_2 = 95 CMAKE_PROGRESS_3 = -CMAKE_PROGRESS_4 = 2 -CMAKE_PROGRESS_5 = 3 -CMAKE_PROGRESS_6 = -CMAKE_PROGRESS_7 = 4 +CMAKE_PROGRESS_4 = 96 +CMAKE_PROGRESS_5 = +CMAKE_PROGRESS_6 = 97 +CMAKE_PROGRESS_7 = 98 CMAKE_PROGRESS_8 = -CMAKE_PROGRESS_9 = 5 -CMAKE_PROGRESS_10 = 6 +CMAKE_PROGRESS_9 = 99 +CMAKE_PROGRESS_10 = 100 Modified: hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/progress.make =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/progress.make 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeFiles/progress.make 2008-09-09 01:09:30 UTC (rev 3407) @@ -1 +1 @@ -6 +7 Modified: hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeLists.txt =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeLists.txt 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/celeste/CMakeLists.txt 2008-09-09 01:09:30 UTC (rev 3407) @@ -14,6 +14,10 @@ Utilities.cpp ) +SET (CELESTE_MODEL + data/celeste.model +) + IF (${HUGIN_SHARED_LIBS}) add_library(celeste SHARED ${CELESTE_SRC}) set_target_properties(celeste PROPERTIES VERSION ${HUGIN_LIB_VERSION}) @@ -21,3 +25,5 @@ ELSE (${HUGIN_SHARED_LIBS}) add_library(celeste STATIC ${CELESTE_SRC}) ENDIF (${HUGIN_SHARED_LIBS}) + +INSTALL(FILES ${CELESTE_MODEL} DESTINATION ${HUGINDATADIR}/xrc/data) Modified: hugin/branches/gsoc2008_sky_identification/src/celeste/cmake_install.cmake =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/celeste/cmake_install.cmake 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/celeste/cmake_install.cmake 2008-09-09 01:09:30 UTC (rev 3407) @@ -12,7 +12,7 @@ STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" "" CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") ELSE(BUILD_TYPE) - SET(CMAKE_INSTALL_CONFIG_NAME "Debug") + SET(CMAKE_INSTALL_CONFIG_NAME "Release") ENDIF(BUILD_TYPE) MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) @@ -32,3 +32,26 @@ SET(CMAKE_INSTALL_SO_NO_EXE "1") ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) +IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" MATCHES "^(Unspecified)$") + IF("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$") + IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libceleste.so.0.0") + FILE(RPATH_CHECK + FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libceleste.so.0.0" + RPATH "") + ENDIF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libceleste.so.0.0") + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES + "/home/tnugent/celeste_gsoc_svn/src/celeste/libceleste.so.0.0" + "/home/tnugent/celeste_gsoc_svn/src/celeste/libceleste.so" + ) + IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libceleste.so.0.0") + IF(CMAKE_INSTALL_DO_STRIP) + EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libceleste.so.0.0") + ENDIF(CMAKE_INSTALL_DO_STRIP) + ENDIF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libceleste.so.0.0") + ENDIF("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$") +ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" MATCHES "^(Unspecified)$") + +IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" MATCHES "^(Unspecified)$") + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/hugin/xrc/data" TYPE FILE FILES "/home/tnugent/celeste_gsoc_svn/src/celeste/data/celeste.model") +ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" MATCHES "^(Unspecified)$") + Modified: hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/AssistantPanel.cpp =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/AssistantPanel.cpp 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/AssistantPanel.cpp 2008-09-09 01:09:30 UTC (rev 3407) @@ -413,101 +413,89 @@ if (t && m_pano->getNrOfCtrlPoints()){ DEBUG_TRACE("Running celeste"); + + + // SVM model file + if ( wxFile::Exists(wxConfigBase::Get()->Read(wxT("/Celeste/Model")) )) { - progress.increaseProgress(1.0, std::string(wxString(_("Running Celeste")).mb_str(wxConvLocal))); + char buf[100]; + strcpy( buf, (const char*)wxConfigBase::Get()->Read(wxT("/Celeste/Model"),wxT(HUGIN_CELESTE_MODEL)).mb_str(wxConvUTF8) ); + string modelfile = buf; + + progress.increaseProgress(1.0, std::string(wxString(_("Running Celeste")).mb_str(wxConvLocal))); - for (unsigned int imgNr = 0; imgNr < m_pano->getNrOfImages() - 1; imgNr++){ + for (unsigned int imgNr = 0; imgNr < m_pano->getNrOfImages() - 1; imgNr++){ - const CPVector & controlPoints = m_pano->getCtrlPoints(); - unsigned int removed = 0; + const CPVector & controlPoints = m_pano->getCtrlPoints(); + unsigned int removed = 0; - gNumLocs = 0; - for (PT::CPVector::const_iterator it = controlPoints.begin(); it != controlPoints.end(); ++it) { - PT::ControlPoint point = *it; - if (imgNr == point.image1Nr){ - gNumLocs++; - } - } + gNumLocs = 0; + for (PT::CPVector::const_iterator it = controlPoints.begin(); it != controlPoints.end(); ++it) { + PT::ControlPoint point = *it; + if (imgNr == point.image1Nr){ + gNumLocs++; + } + } - // Create the storage matrix - gLocations = CreateMatrix( (int)0, gNumLocs, 2); - unsigned int glocation_counter = 0; - unsigned int cp_counter = 0; - vector<unsigned int> global_cp_nr; - //vector<double> xcoord,ycoord; + // Create the storage matrix + gLocations = CreateMatrix( (int)0, gNumLocs, 2); + unsigned int glocation_counter = 0; + unsigned int cp_counter = 0; + vector<unsigned int> global_cp_nr; - for (PT::CPVector::const_iterator it = controlPoints.begin(); it != controlPoints.end(); ++it) { - PT::ControlPoint point = *it; - - if (imgNr == point.image1Nr){ - - //cerr << "---Celeste--- " << m_pano->getImage(point.image1Nr).getFilename() << endl; - //cerr << "---Celeste--- CP " << cp_counter << " x1: " << - //point.x1<<","<< point.y1 << endl; - //xcoord.push_back(point.x1); - //ycoord.push_back(point.y1); - - gLocations[glocation_counter][0] = point.x1; - gLocations[glocation_counter][1] = point.y1; - global_cp_nr.push_back(cp_counter); - glocation_counter++; - - } - cp_counter++; - } + for (PT::CPVector::const_iterator it = controlPoints.begin(); it != controlPoints.end(); ++it) { + PT::ControlPoint point = *it; + if (imgNr == point.image1Nr){ + gLocations[glocation_counter][0] = point.x1; + gLocations[glocation_counter][1] = point.y1; + global_cp_nr.push_back(cp_counter); + glocation_counter++; + } + cp_counter++; + } - - // SVM threshold - double threshold = HUGIN_CELESTE_THRESHOLD; - wxConfigBase::Get()->Read(wxT("/Celeste/Threshold"), &threshold, HUGIN_CELESTE_THRESHOLD); + // SVM threshold + double threshold = HUGIN_CELESTE_THRESHOLD; + wxConfigBase::Get()->Read(wxT("/Celeste/Threshold"), &threshold, HUGIN_CELESTE_THRESHOLD); - // Mask resolution - 1 sets it to fine - bool t = wxConfigBase::Get()->Read(wxT("/Celeste/Filter"), HUGIN_CELESTE_FILTER); - if (t){ - //cerr <<"---Celeste--- Using small filter" << endl; - gRadius = 10; - spacing = (gRadius * 2) + 1; - } + // Mask resolution - 1 sets it to fine + bool t = wxConfigBase::Get()->Read(wxT("/Celeste/Filter"), HUGIN_CELESTE_FILTER); + if (t){ + //cerr <<"---Celeste--- Using small filter" << endl; + gRadius = 10; + spacing = (gRadius * 2) + 1; + } - // Vector to store SVM responses - vector<float> svm_responses; - - // SVM model file - char buf[100]; - strcpy( buf, (const char*)wxConfigBase::Get()->Read(wxT("/Celeste/Model"),wxT(HUGIN_CELESTE_MODEL)).mb_str(wxConvUTF8) ); - string modelfile = buf; + // Vector to store SVM responses + vector<float> svm_responses; - // Image to analyse - string imagefile = m_pano->getImage(imgNr).getFilename(); + // Image to analyse + string imagefile = m_pano->getImage(imgNr).getFilename(); - // Get responses - bool verbose = false; - get_gabor_response(imagefile, modelfile, svm_responses, verbose); + // Get responses + bool verbose = false; + get_gabor_response(imagefile, modelfile, svm_responses, verbose); - DEBUG_TRACE("SVM classification done"); + DEBUG_TRACE("SVM classification done"); - // Print SVM results - for (unsigned int c = 0; c < svm_responses.size(); c++){ - - unsigned int pNr = global_cp_nr[c] - removed; - - if (svm_responses[c] > threshold){ - - - //cerr << "---Celeste--- CP: " << pNr << ": " << c << ": " << svm_responses[c] - // << " - " << xcoord[c] << "," << ycoord[c] << "\tremoved."; - - //DEBUG_DEBUG("about to delete point " << pNr); - GlobalCmdHist::getInstance().addCommand( - new PT::RemoveCtrlPointCmd(*m_pano,pNr) - ); - removed++; + // Print SVM results + for (unsigned int c = 0; c < svm_responses.size(); c++){ + unsigned int pNr = global_cp_nr[c] - removed; + if (svm_responses[c] > threshold){ + //DEBUG_DEBUG("about to delete point " << pNr); + GlobalCmdHist::getInstance().addCommand( + new PT::RemoveCtrlPointCmd(*m_pano,pNr) + ); + removed++; + } } - //cerr << endl; } + }else{ + wxMessageBox(_("Celeste model file not found, Hugin needs to be properly installed." ), _("Fatal Error")); } } DEBUG_TRACE("Finished running celeste"); + progress.increaseProgress(1.0, std::string(wxString(_("Determining placement of the images")).mb_str(wxConvLocal))); Modified: hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/CPEditorPanel.cpp =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/CPEditorPanel.cpp 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/CPEditorPanel.cpp 2008-09-09 01:09:30 UTC (rev 3407) @@ -2167,10 +2167,15 @@ vector<float> svm_responses; // SVM model file + if ( ! wxFile::Exists(cfg->Read(wxT("/Celeste/Model")) )) { + wxMessageBox(_("Celeste model file not found, Hugin needs to be properly installed." ), _("Fatal Error")); + return ; + } + char buf[100]; strcpy( buf, (const char*)cfg->Read(wxT("/Celeste/Model"),wxT(HUGIN_CELESTE_MODEL)).mb_str(wxConvUTF8) ); string modelfile = buf; - + // Image to analyse string imagefile = m_pano->getImage(m_leftImageNr).getFilename(); Modified: hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/PreferencesDialog.cpp =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/PreferencesDialog.cpp 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/PreferencesDialog.cpp 2008-09-09 01:09:30 UTC (rev 3407) @@ -900,8 +900,7 @@ cfg->Write(wxT("/Celeste/Auto"), HUGIN_CELESTE_AUTO); cfg->Write(wxT("/Celeste/Threshold"), HUGIN_CELESTE_THRESHOLD); cfg->Write(wxT("/Celeste/Filter"), HUGIN_CELESTE_FILTER); - cfg->Write(wxT("/Celeste/Model"), wxT(HUGIN_CELESTE_MODEL)); - + cfg->Write(wxT("/Celeste/Model"), MainFrame::Get()->GetXRCPath() + wxT(HUGIN_CELESTE_MODEL)); } /* Modified: hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/config_defaults.h =================================================================== --- hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/config_defaults.h 2008-09-08 23:41:11 UTC (rev 3406) +++ hugin/branches/gsoc2008_sky_identification/src/hugin1/hugin/config_defaults.h 2008-09-09 01:09:30 UTC (rev 3407) @@ -37,7 +37,7 @@ #define HUGIN_CELESTE_AUTO 0l #define HUGIN_CELESTE_THRESHOLD 0l #define HUGIN_CELESTE_FILTER 1l -#define HUGIN_CELESTE_MODEL "celeste.model" +#define HUGIN_CELESTE_MODEL "data/celeste.model" // template matching #define HUGIN_FT_TEMPLATE_SIZE 21l This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |