diff --git a/CMake/ImportSiftFast.cmake b/CMake/ImportSiftFast.cmake new file mode 100644 index 0000000000000000000000000000000000000000..57dfa0feb15d2a5616781ecc0c7927d36a2c49c0 --- /dev/null +++ b/CMake/ImportSiftFast.cmake @@ -0,0 +1,3 @@ +MESSAGE(STATUS "Importing libSiftFast...") +OPTION(OTB_USE_SIFTFAST "Use Fast SIFT Image Features Library" ON) +MARK_AS_ADVANCED(OTB_USE_SIFTFAST) diff --git a/CMake/otbConfigure.h.in b/CMake/otbConfigure.h.in index bf03b25137be9c1a362452a74026056488a89472..79b9b3dfacaf17e1ef1eaf0d0e1f80df58746c1b 100644 --- a/CMake/otbConfigure.h.in +++ b/CMake/otbConfigure.h.in @@ -62,9 +62,12 @@ #cmakedefine OTB_USE_CURL #cmakedefine OTB_CURL_MULTI_AVAILABLE -/* Curl */ +/* OpenJpeg */ #cmakedefine OTB_USE_JPEG2000 +/* SiftFast */ +#cmakedefine OTB_USE_SIFTFAST + /* Use Visu/Gui configurations */ #cmakedefine OTB_USE_VISU_GUI diff --git a/CMake/otbIncludeDirectories.cmake b/CMake/otbIncludeDirectories.cmake index 4a755a7ec8320245d8f001312216647b209e53f1..0961d6a7b56a336dddbee44e42baa72ba1af263a 100644 --- a/CMake/otbIncludeDirectories.cmake +++ b/CMake/otbIncludeDirectories.cmake @@ -72,7 +72,6 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} ${OTB_SOURCE_DIR}/Utilities/otbedison/segm ${OTB_SOURCE_DIR}/Utilities/otbedison/prompt ${OTB_SOURCE_DIR}/Utilities/otbedison/edge - ${OTB_SOURCE_DIR}/Utilities/otbsiftfast ${OTB_SOURCE_DIR}/Utilities/otbconfigfile ${OTB_SOURCE_DIR}/Utilities/otbknn ${OTB_SOURCE_DIR}/Utilities/otbmuparser @@ -106,6 +105,10 @@ IF(OTB_USE_PQXX) ${OTB_SOURCE_DIR}/Code/GeospatialAnalysis) ENDIF(OTB_USE_PQXX) +IF(OTB_USE_SIFTFAST) + SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} + ${OTB_SOURCE_DIR}/Utilities/otbsiftfast) +ENDIF(OTB_USE_SIFTFAST) #----------------------------------------------------------------------------- # Include directories from the ossim build tree @@ -325,7 +328,6 @@ SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS} Utilities/otbkml/third_party/boost_1_34_1 Utilities/otbliblas/include Utilities/otbedison - Utilities/otbsiftfast Utilities/otbconfigfile Utilities/otbknn Utilities/otbmuparser @@ -368,6 +370,11 @@ IF(OTB_USE_GETTEXT) ${GETTEXT_INCLUDE_DIR} ) ENDIF(OTB_USE_GETTEXT) +IF(OTB_USE_SIFTFAST) + SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS} + Utilities/otbsiftfast) +ENDIF(OTB_USE_SIFTFAST) + #For FLTK header file IF(OTB_USE_EXTERNAL_FLTK) SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS} diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dc93a54e4119f79dec5071ae5bba922cf274ac3..7ed9f55bd6863308540831cfd607f14453c1a395 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,6 +229,7 @@ INCLUDE(ImportOpenThreads) INCLUDE(ImportOssim) INCLUDE(ImportQt4) INCLUDE(ImportGetText) +INCLUDE(ImportSiftFast) INCLUDE_DIRECTORIES ( diff --git a/Code/FeatureExtraction/CMakeLists.txt b/Code/FeatureExtraction/CMakeLists.txt index 5b3f420ff737186ec79110d8bcd5ebadfed7ea3e..7eb071be20dd05ad7666e3935337de24cb9f0a97 100644 --- a/Code/FeatureExtraction/CMakeLists.txt +++ b/Code/FeatureExtraction/CMakeLists.txt @@ -4,7 +4,11 @@ FILE(GLOB OTBFeatureExtraction_SRCS "*.cxx" ) ADD_LIBRARY(OTBFeatureExtraction ${OTBFeatureExtraction_SRCS}) -TARGET_LINK_LIBRARIES (OTBFeatureExtraction OTBCommon otbsiftfast) +TARGET_LINK_LIBRARIES (OTBFeatureExtraction OTBCommon) +IF(OTB_USE_SIFTFAST) + TARGET_LINK_LIBRARIES (OTBFeatureExtraction otbsiftfast) +ENDIF(OTB_USE_SIFTFAST) + IF(OTB_LIBRARY_PROPERTIES) SET_TARGET_PROPERTIES(OTBFeatureExtraction PROPERTIES ${OTB_LIBRARY_PROPERTIES}) ENDIF(OTB_LIBRARY_PROPERTIES) @@ -19,6 +23,11 @@ ENDIF(NOT OTB_INSTALL_NO_LIBRARIES) IF(NOT OTB_INSTALL_NO_DEVELOPMENT) FILE(GLOB __files1 "${CMAKE_CURRENT_SOURCE_DIR}/*.h") FILE(GLOB __files2 "${CMAKE_CURRENT_SOURCE_DIR}/*.txx") + IF( NOT OTB_USE_SIFTFAST ) + LIST(REMOVE_ITEM __files1 "${CMAKE_CURRENT_SOURCE_DIR}/otbSiftFastImageFilter.h" ) + LIST(REMOVE_ITEM __files2 "${CMAKE_CURRENT_SOURCE_DIR}/otbSiftFastImageFilter.txx" ) + ENDIF( NOT OTB_USE_SIFTFAST ) + INSTALL(FILES ${__files1} ${__files2} DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/FeatureExtraction COMPONENT Development) diff --git a/Examples/Patented/CMakeLists.txt b/Examples/Patented/CMakeLists.txt index 23828b57fec50ed6e4b7121e5e0dcf9f299300f1..df0d2fc0c638672a242a5d0da09b26f9da843e17 100644 --- a/Examples/Patented/CMakeLists.txt +++ b/Examples/Patented/CMakeLists.txt @@ -22,12 +22,15 @@ ADD_EXECUTABLE(SIFTExample SIFTExample.cxx) TARGET_LINK_LIBRARIES(SIFTExample OTBIO OTBCommon OTBFeatureExtraction ITKCommon ITKBasicFilters) -ADD_EXECUTABLE(SIFTFastExample SIFTFastExample.cxx) -TARGET_LINK_LIBRARIES(SIFTFastExample OTBIO OTBCommon OTBFeatureExtraction -ITKCommon ITKBasicFilters) +IF(OTB_USE_SIFTFAST) + + ADD_EXECUTABLE(SIFTFastExample SIFTFastExample.cxx) + TARGET_LINK_LIBRARIES(SIFTFastExample OTBIO OTBCommon OTBFeatureExtraction ITKCommon ITKBasicFilters) + + ADD_EXECUTABLE(SIFTDensityExample SIFTDensityExample.cxx) + TARGET_LINK_LIBRARIES(SIFTDensityExample OTBIO OTBCommon OTBBasicFilters ITKCommon ITKBasicFilters) -ADD_EXECUTABLE(SIFTDensityExample SIFTDensityExample.cxx) -TARGET_LINK_LIBRARIES(SIFTDensityExample OTBIO OTBCommon OTBBasicFilters ITKCommon ITKBasicFilters) +ENDIF(OTB_USE_SIFTFAST) IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING ) @@ -101,7 +104,7 @@ ADD_TEST(feTeScaleInvariantFeatureImageFilterTest ${EXE_TESTS} 1 10 0.5 0 ) - +IF(OTB_USE_SIFTFAST) ADD_TEST(feTeSIFTFastExampleTest ${EXE_TESTS} --compare-image ${TOL} ${BASELINE}/ROISpot5SiftFast.png @@ -111,7 +114,7 @@ ADD_TEST(feTeSIFTFastExampleTest ${EXE_TESTS} ${TEMP}/ROISpot5SiftFast.png 3 ) - +ENDIF(OTB_USE_SIFTFAST) INCLUDE_DIRECTORIES(${OTB_SOURCE_DIR}/Testing/Code) ADD_EXECUTABLE(otbPatentedExamplesTests otbPatentedExamplesTests.cxx) diff --git a/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionTest.cxx b/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionTest.cxx index 71ed585c1925ae2f8de100d4e0cc65379469d0a9..332f73a9076190ceb57b249dc8d08b7e397bf4be 100644 --- a/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionTest.cxx +++ b/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionTest.cxx @@ -20,7 +20,6 @@ #include "otbPointSetDensityEpanechnikovFunction.h" #include "itkPointSet.h" #include "itkVariableLengthVector.h" -#include "otbSiftFastImageFilter.h" #include <iostream> diff --git a/Testing/Code/BasicFilters/otbPointSetDensityFunctionTest.cxx b/Testing/Code/BasicFilters/otbPointSetDensityFunctionTest.cxx index 47d8341c985e7bd6e84c4e42f4af4fa0529a3d9b..369159c81812a2c2d4c4004ea6e6e802e3a0b7e6 100644 --- a/Testing/Code/BasicFilters/otbPointSetDensityFunctionTest.cxx +++ b/Testing/Code/BasicFilters/otbPointSetDensityFunctionTest.cxx @@ -20,7 +20,6 @@ #include "otbPointSetDensityFunction.h" #include "itkPointSet.h" #include "itkVariableLengthVector.h" -#include "otbSiftFastImageFilter.h" #include <iostream> diff --git a/Testing/Code/BasicFilters/otbPointSetDensityGaussianFunctionTest.cxx b/Testing/Code/BasicFilters/otbPointSetDensityGaussianFunctionTest.cxx index 320f5bc3936338f0194219040153ce454a1688c7..57eb47c6fed28c7f78681aae0b4bf187c7f23abf 100644 --- a/Testing/Code/BasicFilters/otbPointSetDensityGaussianFunctionTest.cxx +++ b/Testing/Code/BasicFilters/otbPointSetDensityGaussianFunctionTest.cxx @@ -20,7 +20,6 @@ #include "otbPointSetDensityGaussianFunction.h" #include "itkPointSet.h" #include "itkVariableLengthVector.h" -#include "otbSiftFastImageFilter.h" #include <iostream> diff --git a/Testing/Code/FeatureExtraction/CMakeLists.txt b/Testing/Code/FeatureExtraction/CMakeLists.txt index b54b0da0a438f1a1977c96462b234c827b3093bc..50bcb8b8f01aec99771f3d409b8825bfaece4eb4 100644 --- a/Testing/Code/FeatureExtraction/CMakeLists.txt +++ b/Testing/Code/FeatureExtraction/CMakeLists.txt @@ -1039,6 +1039,7 @@ ADD_TEST(feTvImageToSURFKeyPointSetFilterSceneOutputDescriptorAscii ${FEATUREEXT # ------- otb::ImageToFastSIFTKeyPointSetFilter ------------- +IF(OTB_USE_SIFTFAST) ADD_TEST(feTuImageToFastSIFTKeyPointSetFilterNew ${FEATUREEXTRACTION_TESTS10} otbImageToFastSIFTKeyPointSetFilterNew) @@ -1064,6 +1065,7 @@ ADD_TEST(feTvImageToFastSIFTKeyPointSetFilterSceneOutputInterestPointAscii ${FEA 6 ) +ENDIF(OTB_USE_SIFTFAST) # --------- MatchingFilter ---------------- diff --git a/Testing/Code/FeatureExtraction/otbFeatureExtractionTests10.cxx b/Testing/Code/FeatureExtraction/otbFeatureExtractionTests10.cxx index c4d52b787e98e867a74c9c88bca52593112bace4..b69d9178b19973b9dbe6fc6df41fbe31d31734bf 100644 --- a/Testing/Code/FeatureExtraction/otbFeatureExtractionTests10.cxx +++ b/Testing/Code/FeatureExtraction/otbFeatureExtractionTests10.cxx @@ -27,9 +27,11 @@ void RegisterTests() REGISTER_TEST(otbImageToSURFKeyPointSetFilterNew); REGISTER_TEST(otbImageToSURFKeyPointSetFilterOutputInterestPointAscii); REGISTER_TEST(otbImageToSURFKeyPointSetFilterOutputDescriptorAscii); +#ifdef OTB_USE_SIFTFAST REGISTER_TEST(otbImageToFastSIFTKeyPointSetFilterNew); REGISTER_TEST(otbImageToFastSIFTKeyPointSetFilterOutputInterestPointAscii); REGISTER_TEST(otbImageToFastSIFTKeyPointSetFilterOutputDescriptorAscii); +#endif REGISTER_TEST(otbKeyPointSetsMatchingFilterNew); REGISTER_TEST(otbKeyPointSetsMatchingFilter); REGISTER_TEST(otbLandmarkNew); diff --git a/Testing/Utilities/CMakeLists.txt b/Testing/Utilities/CMakeLists.txt index dcd7545f55bea00ddb19065075f84bb92a2a52a0..3f083f2c59355abd408e4e35f2b0f5ca6400de5f 100644 --- a/Testing/Utilities/CMakeLists.txt +++ b/Testing/Utilities/CMakeLists.txt @@ -335,6 +335,9 @@ ijObjectLabelAttributeValuesTest.cxx ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx ) +IF(OTB_USE_SIFTFAST) + SET(UtilitiesTests_SRCS ${UtilitiesTests_SRCS} siftfast.cpp) +ENDIF(OTB_USE_SIFTFAST) IF(OTB_USE_JPEG2000) # SET(UtilitiesTests_SRCS ${UtilitiesTests_SRCS} openJpegEncoder.cxx openJpegDecoder.cxx) @@ -369,12 +372,16 @@ ENDIF(NOT OTB_USE_EXTERNAL_EXPAT) # ------- Select sources files suppress warning ----------------------------------- SET(UtilitiesTests_DisableWarning_SRCS - siftfast.cpp openthreadsWorkCrew.cpp expatchardata.cxx expatminicheck.cxx expatruntests.cxx ) + +IF(OTB_USE_SIFTFAST) + SET(UtilitiesTests_DisableWarning_SRCS ${UtilitiesTests_DisableWarning_SRCS} siftfast.cpp) +ENDIF(OTB_USE_SIFTFAST) + IF(CMAKE_COMPILER_IS_GNUCXX) SET_SOURCE_FILES_PROPERTIES( ${UtilitiesTests_DisableWarning_SRCS} PROPERTIES COMPILE_FLAGS -w) ELSE(CMAKE_COMPILER_IS_GNUCXX) @@ -393,7 +400,11 @@ IF(NOT BUILD_SHARED_LIBS) ENDIF(NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE(otbUtilitiesTests otbUtilitiesTests.cxx ${UtilitiesTests_SRCS}) -TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon OTBTesting otbsvm otb6S tinyXML otbkml otbsiftfast) +TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon OTBTesting otbsvm otb6S tinyXML otbkml) + +IF(OTB_USE_SIFTFAST) + TARGET_LINK_LIBRARIES(otbUtilitiesTests otbsiftfast) +ENDIF(OTB_USE_SIFTFAST) IF(OTB_USE_JPEG2000) TARGET_LINK_LIBRARIES(otbUtilitiesTests otbopenjpeg) diff --git a/Testing/Utilities/otbUtilitiesTests.cxx b/Testing/Utilities/otbUtilitiesTests.cxx index 5177dc0fad1b6b3287a57d0dfbc0a81fe358837f..3123cb5b136ceb9cfae9b05c196eaf6d5941772b 100644 --- a/Testing/Utilities/otbUtilitiesTests.cxx +++ b/Testing/Utilities/otbUtilitiesTests.cxx @@ -77,7 +77,10 @@ REGISTER_TEST(kmlsharedstyles); REGISTER_TEST(kmlsimplifylines); REGISTER_TEST(kmlsortplacemarks); +#ifdef OTB_USE_SIFTFAST REGISTER_TEST(SiftFast); +#endif + REGISTER_TEST(ijObjectLabelAttributeValuesTest); REGISTER_TEST(ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest); } diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index cf912dc2b205409db7b4f64443bf5c43b7ebeb4c..3e025b98f4d5c910358172a0d211075379846218 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -74,8 +74,12 @@ MESSAGE(STATUS "Configuring otbkml...") ADD_SUBDIRECTORY(otbkml) MESSAGE(STATUS "Configuring otbedison...") ADD_SUBDIRECTORY(otbedison) -MESSAGE(STATUS "Configuring otbsiftfast...") -ADD_SUBDIRECTORY(otbsiftfast) + +IF(OTB_USE_SIFTFAST) + MESSAGE(STATUS "Configuring otbsiftfast...") + ADD_SUBDIRECTORY(otbsiftfast) +ENDIF(OTB_USE_SIFTFAST) + MESSAGE(STATUS "Configuring otbconfigfile...") ADD_SUBDIRECTORY(otbconfigfile)