Commit 9b896a88 authored by Rashad Kanavath's avatar Rashad Kanavath

ENH: Build examples if a dependent module is available.

Earlier one needs all otb modules to build examples. This single commit
activate an example and its related test if and only if all of its
dependent module is activated. The check for a module is done using
<Module>_LOADED cmake variable. With this change, activating
BUILD_EXAMPLES=ON works flawlessly irrespective of your build configuration.
parent 5512ff90
project(BasicFiltersExamples)
#OTB_USE_MUPARSER is OFF
if(OTBMathParser_LOADED)
add_executable(BandMathFilterExample BandMathFilterExample.cxx)
target_link_libraries(BandMathFilterExample ${OTB_LIBRARIES})
endif()
#OTB_USE_MUPARSERX is OFF
if(OTBMathParserX_LOADED)
add_executable(BandMathXImageFilterExample BandMathXImageFilterExample.cxx)
target_link_libraries(BandMathXImageFilterExample ${OTB_LIBRARIES})
endif()
add_executable(DEMToRainbowExample DEMToRainbowExample.cxx)
target_link_libraries(DEMToRainbowExample ${OTB_LIBRARIES})
......@@ -21,8 +27,11 @@ target_link_libraries(IndexedToRGBExample ${OTB_LIBRARIES})
add_executable(LeeImageFilter LeeImageFilter.cxx)
target_link_libraries(LeeImageFilter ${OTB_LIBRARIES})
#OTBMeanShift depends OTBMathParser. But OTB_USE_MUPARSER is OFF
if(OTBMeanShift_LOADED)
add_executable(MeanShiftSegmentationFilterExample MeanShiftSegmentationFilterExample.cxx)
target_link_libraries(MeanShiftSegmentationFilterExample ${OTB_LIBRARIES})
endif()
add_executable(PrintableImageFilterExample PrintableImageFilterExample.cxx)
target_link_libraries(PrintableImageFilterExample ${OTB_LIBRARIES})
......
......@@ -84,7 +84,7 @@ otb_add_test(NAME bfTeIndexedToRGBExampleTest COMMAND ${OTB_TEST_DRIVER}
${TEMP}/buildingExtractionRGB.png
${TEMP}/buildingExtractionIndexed_scaled.png
)
if(OTBMeanShift_LOADED)
otb_add_test(NAME bfTeMeanShiftSegmentationFilterExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-n-images ${NOTOL} 4
${BASELINE}/MSClusteredOutput.tif
......@@ -107,7 +107,7 @@ otb_add_test(NAME bfTeMeanShiftSegmentationFilterExampleTest COMMAND ${OTB_TEST_
100
0.1
)
endif()
# ------- HillShadingExampleTest ----------
otb_add_test(NAME bfTeHillShadingExampleTest COMMAND ${OTB_TEST_DRIVER}
......
......@@ -81,32 +81,12 @@ if(PROJECT_NAME STREQUAL "OTBExamples")
########################## end copied from OTB/CMakeLists.txt ##########################
#must be updated for new modules!
set(REQUIRED_MODULES "OTB6S;OTBITK;OTBAnomalyDetection;OTBBoost;OTBCommon;OTBGDAL;OTBOpenThreads;OTBOssim;OTBGeoTIFF;OTBOssimPlugins;OTBOSSIMAdapters;OTBObjectList;OTBMetadata;OTBImageBase;OTBBoostAdapters;OTBGdalAdapters;OTBTinyXML;OTBVectorDataBase;OTBIOGDAL;OTBExtendedFilename;OTBIOBSQ;OTBIOLUM;OTBIOMSTAR;OTBIOMW;OTBIOONERA;OTBIORAD;OTBCurl;OTBCurlAdapters;OTBIOTileMap;OTBStreaming;OTBImageIO;OTBInterpolation;OTBTransform;OTBImageManipulation;OTBTestKernel;OTBPath;OTBVectorDataManipulation;OTBProjection;OTBlibkml;OTBIOKML;OTBVectorDataIO;OTBApplicationEngine;OTBStatistics;OTBChangeDetection;OTBAppChangeDetection;OTBCommandLine;OTBColorMap;OTBMoments;OTBLabelMap;OTBConversion;OTBFuzzy;OTBMuParser;OTBMathParser;OTBSupervised;OTBDempsterShafer;OTBIOXML;OTBIndices;OTBMajorityVoting;OTBSOM;OTBAppClassification;OTBPointSet;OTBSiftFast;OTBDescriptors;OTBAppDescriptors;OTBDimensionalityReduction;OTBAppDimensionalityReduction;OTBSpatialObjects;OTBEdge;OTBAppEdge;OTBImageNoise;OTBAppFiltering;OTBConvolution;OTBPanSharpening;OTBAppFusion;OTBEndmembersExtraction;OTBWavelet;OTBUnmixing;OTBAppHyperspectral;OTBCarto;OTBAppImageUtils;OTBAppIndices;OTBKMZWriter;OTBAppKMZ;OTBAppMathParser;OTBMuParserX;OTBMathParserX;OTBAppMathParserX;OTBAppMoments;OTBAppMorphology;OTBOpticalCalibration;OTBAppOpticalCalibration;OTBAppProjection;OTBSARCalibration;OTBAppSARCalibration;OTBCCOBIA;OTBSmoothing;OTBMeanShift;OTBMetrics;OTBMorphologicalProfiles;OTBLabelling;OTBOGRProcessing;OTBWatersheds;OTBAppSegmentation;OTBDEM;OTBStereo;OTBDisparityMap;OTBAppStereo;OTBAppTest;OTBTextures;OTBAppTextures;OTBAppVectorDataTranslation;OTBAppVectorUtils;OTBCommandLineParser;OTBOpenThreadsAdapters;OTBCloudDetection;OTBComplexImage;OTBCorner;OTBDensity;OTBDisplacementField;OTBLandSatClassifier;OTBLearningBase;OTBMarkov;OTBMorphologicalPyramid;OTBObjectDetection;OTBPolarimetry;OTBRoadExtraction;OTBRCC8;OTBSWIGWrapper;OTBSeamCarving;OTBSimulation;OTBTimeSeries;OTBUrbanArea")
find_package(OTB REQUIRED COMPONENTS ${REQUIRED_MODULES})
include(${OTB_USE_FILE})
message(STATUS "Found OTB: ${OTB_USE_FILE}")
else()
if(NOT OTB_BUILD_DEFAULT_MODULES)
message(FATAL_ERROR "BUILD_EXAMPLES requires OTB_BUILD_DEFAULT_MODULES to be ON")
endif()
# We also need to prevent any OTB_USE_XXX option to be OFF (except mapnik and openjpeg)
# For now we parse module activation list and test if option is ON. If not the cmake configuration stop.
#TODO We should provide a better mechanism here wich will deactivate only examples required by deactivated options.
foreach (_activationOption ${OTB_MODULE_ACTIVATION_OPTION_LIST})
if(NOT ${_activationOption} AND NOT "x${_activationOption}" STREQUAL "xOTB_USE_MAPNIK" AND NOT "x${_activationOption}" STREQUAL "xOTB_USE_OPENJPEG")
message(FATAL_ERROR "BUILD_EXAMPLES requires ${_activationOption} to be ON")
endif()
endforeach()
find_package(OTB REQUIRED)
include(${OTB_USE_FILE})
message(STATUS "Found OTB: ${OTB_USE_FILE}")
endif()
find_package(OTB REQUIRED)
include(${OTB_USE_FILE})
message(STATUS "Found OTB: ${OTB_USE_FILE}")
set(OTB_TEST_DRIVER otbTestDriver)
if(OTBApplicationEngine_LOADED)
......
......@@ -6,9 +6,11 @@ target_link_libraries(BayesianPluginClassifier ${OTB_LIBRARIES})
add_executable(ClassificationMapRegularizationExample ClassificationMapRegularizationExample.cxx)
target_link_libraries(ClassificationMapRegularizationExample ${OTB_LIBRARIES})
#OTBDempsterShafer depends OTBMathParser. But OTB_USE_MUPARSER is OFF
if(OTBDempsterShafer_LOADED)
add_executable(DempsterShaferFusionOfClassificationMapsExample DempsterShaferFusionOfClassificationMapsExample.cxx)
target_link_libraries(DempsterShaferFusionOfClassificationMapsExample ${OTB_LIBRARIES})
endif()
add_executable(ExpectationMaximizationMixtureModelEstimator ExpectationMaximizationMixtureModelEstimator.cxx)
target_link_libraries(ExpectationMaximizationMixtureModelEstimator ${OTB_LIBRARIES})
......
......@@ -9,8 +9,11 @@ target_link_libraries(NCCRegistrationFilterExample ${OTB_LIBRARIES})
add_executable(SimpleDisparityMapEstimationExample SimpleDisparityMapEstimationExample.cxx)
target_link_libraries(SimpleDisparityMapEstimationExample ${OTB_LIBRARIES})
#StereoReconstructionExample depends OTBMathParser. But OTB_USE_MUPARSER is OFF
if(OTBMathParser_LOADED)
add_executable(StereoReconstructionExample StereoReconstructionExample.cxx)
target_link_libraries(StereoReconstructionExample ${OTB_LIBRARIES})
endif()
if(BUILD_TESTING)
add_subdirectory(test)
......
......@@ -17,6 +17,7 @@ otb_add_test(NAME dmTeSimpleDisparityMapEstimationExampleTest COMMAND ${OTB_TEST
100 10 15 10 10 250 0.9
)
if(OTBMathParser_LOADED)
otb_add_test(NAME dmTeStereoReconstructionExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${NOTOL}
${BASELINE}/elevationOutput.tif
......@@ -28,3 +29,4 @@ otb_add_test(NAME dmTeStereoReconstructionExampleTest COMMAND ${OTB_TEST_DRIVER}
${TEMP}/elevationOutputPrintable.png
140
)
endif()
\ No newline at end of file
project(FeatureExtractionExamples)
add_executable(AlignmentsExample AlignmentsExample.cxx)
target_link_libraries(AlignmentsExample ${OTB_LIBRARIES})
add_executable(AssymmetricFusionOfLineDetectorExample AssymmetricFusionOfLineDetectorExample.cxx)
target_link_libraries(AssymmetricFusionOfLineDetectorExample ${OTB_LIBRARIES})
......@@ -21,12 +18,20 @@ target_link_libraries(CorrelationLineDetectorExample ${OTB_LIBRARIES})
add_executable(EdgeDensityExample EdgeDensityExample.cxx)
target_link_libraries(EdgeDensityExample ${OTB_LIBRARIES})
if(OTBRoadExtraction_LOADED)
add_executable(ExtractRoadByStepsExample ExtractRoadByStepsExample.cxx)
target_link_libraries(ExtractRoadByStepsExample ${OTB_LIBRARIES})
add_executable(ExtractRoadExample ExtractRoadExample.cxx)
target_link_libraries(ExtractRoadExample ${OTB_LIBRARIES})
add_executable(ParallelLineDetectionExample ParallelLineDetectionExample.cxx)
target_link_libraries(ParallelLineDetectionExample ${OTB_LIBRARIES})
add_executable(AlignmentsExample AlignmentsExample.cxx)
target_link_libraries(AlignmentsExample ${OTB_LIBRARIES})
endif()
add_executable(ExtractSegmentsByStepsExample ExtractSegmentsByStepsExample.cxx)
target_link_libraries(ExtractSegmentsByStepsExample ${OTB_LIBRARIES})
......@@ -45,6 +50,9 @@ target_link_libraries(HuMomentsImageFunctionExample ${OTB_LIBRARIES})
if (Module_OTBVectorDataRendering AND OTB_USE_MAPNIK)
add_executable(LineSegmentDetectorExample LineSegmentDetectorExample.cxx)
target_link_libraries(LineSegmentDetectorExample ${OTB_LIBRARIES})
add_executable(RightAngleDetectionExample RightAngleDetectionExample.cxx)
target_link_libraries(RightAngleDetectionExample ${OTB_LIBRARIES})
endif()
add_executable(LocalHoughExample LocalHoughExample.cxx)
......@@ -53,17 +61,9 @@ target_link_libraries(LocalHoughExample ${OTB_LIBRARIES})
add_executable(PanTexExample PanTexExample.cxx)
target_link_libraries(PanTexExample ${OTB_LIBRARIES})
add_executable(ParallelLineDetectionExample ParallelLineDetectionExample.cxx)
target_link_libraries(ParallelLineDetectionExample ${OTB_LIBRARIES})
add_executable(RatioLineDetectorExample RatioLineDetectorExample.cxx)
target_link_libraries(RatioLineDetectorExample ${OTB_LIBRARIES})
if (Module_OTBVectorDataRendering AND OTB_USE_MAPNIK)
add_executable(RightAngleDetectionExample RightAngleDetectionExample.cxx)
target_link_libraries(RightAngleDetectionExample ${OTB_LIBRARIES})
endif()
add_executable(SeamCarvingExample SeamCarvingExample.cxx)
target_link_libraries(SeamCarvingExample ${OTB_LIBRARIES})
......
......@@ -107,7 +107,7 @@ otb_add_test(NAME feTeRatioLineDetectorExampleTest COMMAND ${OTB_TEST_DRIVER}
)
# ------- AlignmentsExampleTest----------
if(OTBRoadExtraction_LOADED)
otb_add_test(NAME feTeAlignmentsExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-n-images ${NOTOL} 1
${BASELINE}/QB_SuburbAlign.png
......@@ -145,6 +145,8 @@ otb_add_test(NAME feTeExtractRoadExampleTest COMMAND ${OTB_TEST_DRIVER}
337 557 432 859 1.0 0.00005 1.0 0.39269 1.0 10.0 25.
)
endif()
# ------- SeamCarvingExamplesTest----------
otb_add_test(NAME feTeSeamCarvingExampleTest COMMAND ${OTB_TEST_DRIVER}
......
......@@ -30,8 +30,10 @@ target_link_libraries(ImageReadWrite ${OTB_LIBRARIES})
add_executable(ImageSeriesIOExample ImageSeriesIOExample.cxx)
target_link_libraries(ImageSeriesIOExample ${OTB_LIBRARIES})
if(OTBKMZWriter_LOADED)
add_executable(ImageToKmzAndMapFileProductExample ImageToKmzAndMapFileProductExample.cxx)
target_link_libraries(ImageToKmzAndMapFileProductExample ${OTB_LIBRARIES})
endif()
add_executable(MetadataExample MetadataExample.cxx)
target_link_libraries(MetadataExample ${OTB_LIBRARIES})
......
......@@ -43,6 +43,7 @@ otb_add_test(NAME prTeDEMHandlerExampleTest COMMAND ${OTB_TEST_DRIVER}
0.001
)
if(OTBKMZWriter_LOADED)
otb_add_test(NAME ioTeImageToKmzAndMapFileProductExample COMMAND ${OTB_TEST_DRIVER}
Execute $<TARGET_FILE:ImageToKmzAndMapFileProductExample>
${OTB_DATA_ROOT}/Input/Haiti1_sr10.jpeg
......@@ -78,6 +79,7 @@ otb_add_test(NAME ioTeImageToKmzAndMapFileProductExample COMMAND ${OTB_TEST_DRIV
42.000000 232.000000 -72.426552 18.540876 0.000000
)
set_property(TEST ioTeImageToKmzAndMapFileProductExample PROPERTY RESOURCE_LOCK web_access)
endif()
otb_add_test(NAME ioTeTileMapImageIOExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-image 10.0
......
......@@ -12,6 +12,7 @@ target_link_libraries(SOMClassifierExample ${OTB_LIBRARIES})
add_executable(SOMExample SOMExample.cxx)
target_link_libraries(SOMExample ${OTB_LIBRARIES})
if(OTBSVMLearning_LOADED)
add_executable(SVMImageClassificationExample SVMImageClassificationExample.cxx)
target_link_libraries(SVMImageClassificationExample ${OTB_LIBRARIES})
......@@ -29,13 +30,15 @@ target_link_libraries(SVMPointSetExample ${OTB_LIBRARIES})
add_executable(SVMPointSetModelEstimatorExample SVMPointSetModelEstimatorExample.cxx)
target_link_libraries(SVMPointSetModelEstimatorExample ${OTB_LIBRARIES})
endif()
if(OTBOpenCV_LOADED)
add_executable(TrainMachineLearningModelFromImagesExample TrainMachineLearningModelFromImagesExample.cxx)
target_link_libraries(TrainMachineLearningModelFromImagesExample ${OTB_LIBRARIES})
add_executable(TrainMachineLearningModelFromSamplesExample TrainMachineLearningModelFromSamplesExample.cxx)
target_link_libraries(TrainMachineLearningModelFromSamplesExample ${OTB_LIBRARIES})
endif()
if(BUILD_TESTING)
add_subdirectory(test)
......
......@@ -3,6 +3,7 @@ set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
# ------- SVMImageClassificationExampleTest----------
if(OTBSVMLearning_LOADED)
otb_add_test(NAME leTeSVMImageClassificationExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-n-images ${NOTOL} 1
${BASELINE}/ROI_QB_MUL_1_SVN_CLASS.png
......@@ -26,18 +27,6 @@ otb_add_test(NAME leTeSVMImageEstimatorClassificationMultiExampleTest COMMAND ${
${TEMP}/ROI_QB_MUL_1_SVN_CLASS_MULTI_Rescaled.png
)
# ------- GenerateTrainingImageExampleTest----------
otb_add_test(NAME leTeGenerateTrainingImageExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-n-images ${NOTOL} 1
${BASELINE}/ROI_QB_MUL_4_training.png
${TEMP}/ROI_QB_MUL_4_training.png
Execute $<TARGET_FILE:GenerateTrainingImageExample>
${INPUTDATA}/ROI_QB_MUL_4.tif
${INPUTDATA}/LearningROIs.txt
${TEMP}/ROI_QB_MUL_4_training.png
)
# ------- SVMImageModelEstimatorExampleTest----------
otb_add_test(NAME leTeSVMImageModelEstimatorExampleTest COMMAND ${OTB_TEST_DRIVER}
......@@ -51,6 +40,18 @@ otb_add_test(NAME leTeSVMImageModelEstimatorExampleTest COMMAND ${OTB_TEST_DRIVE
${TEMP}/svm_image_model.svn
)
endif()
# ------- GenerateTrainingImageExampleTest----------
otb_add_test(NAME leTeGenerateTrainingImageExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-n-images ${NOTOL} 1
${BASELINE}/ROI_QB_MUL_4_training.png
${TEMP}/ROI_QB_MUL_4_training.png
Execute $<TARGET_FILE:GenerateTrainingImageExample>
${INPUTDATA}/ROI_QB_MUL_4.tif
${INPUTDATA}/LearningROIs.txt
${TEMP}/ROI_QB_MUL_4_training.png
)
# ------- SOMExampleTest----------
......
......@@ -12,8 +12,10 @@ target_link_libraries(KeepNObjects ${OTB_LIBRARIES})
add_executable(LabelMapToVectorData LabelMapToVectorData.cxx)
target_link_libraries(LabelMapToVectorData ${OTB_LIBRARIES})
if(OTBMeanShift_LOADED)
add_executable(RadiometricAttributesLabelMapFilterExample RadiometricAttributesLabelMapFilterExample.cxx)
target_link_libraries(RadiometricAttributesLabelMapFilterExample ${OTB_LIBRARIES})
endif()
add_executable(ShapeAttributeComputation ShapeAttributeComputation.cxx)
target_link_libraries(ShapeAttributeComputation ${OTB_LIBRARIES})
......
......@@ -22,6 +22,7 @@ otb_add_test(NAME trTeOBIAShapeAttributeComputationTest COMMAND ${OTB_TEST_DRIVE
${TEMP}/OBIAShapeAttribute.txt
)
if(OTBMeanShift_LOADED)
otb_add_test(NAME trTeOBIARadiometricAttributesLabelMapFilterTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${NOTOL}
${BASELINE}/OBIARadiometricAttributes.png
......@@ -38,6 +39,7 @@ otb_add_test(NAME trTeOBIARadiometricAttributesLabelMapFilterTest COMMAND ${OTB_
50
1.0
)
endif()
otb_add_test(NAME trTeLabelMapToVectorData COMMAND ${OTB_TEST_DRIVER}
Execute $<TARGET_FILE:LabelMapToVectorData>
......
......@@ -3,18 +3,18 @@ project(PatentedExamples)
add_executable(EstimateAffineTransformationExample EstimateAffineTransformationExample.cxx)
target_link_libraries(EstimateAffineTransformationExample ${OTB_LIBRARIES})
if (OTBSiftFast_LOADED)
add_executable(SIFTDisparityMapEstimation SIFTDisparityMapEstimation.cxx)
target_link_libraries(SIFTDisparityMapEstimation ${OTB_LIBRARIES})
add_executable(SIFTExample SIFTExample.cxx)
target_link_libraries(SIFTExample ${OTB_LIBRARIES})
if (Module_OTBSiftFast)
add_executable(SIFTDensityExample SIFTDensityExample.cxx)
target_link_libraries(SIFTDensityExample ${OTB_LIBRARIES})
add_executable(SIFTDensityExample SIFTDensityExample.cxx)
target_link_libraries(SIFTDensityExample ${OTB_LIBRARIES})
add_executable(SIFTFastExample SIFTFastExample.cxx)
target_link_libraries(SIFTFastExample ${OTB_LIBRARIES})
add_executable(SIFTFastExample SIFTFastExample.cxx)
target_link_libraries(SIFTFastExample ${OTB_LIBRARIES})
endif()
if(BUILD_TESTING)
......
......@@ -3,8 +3,10 @@ project(RadiometryExamples)
add_executable(ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx)
target_link_libraries(ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter ${OTB_LIBRARIES})
if(OTBOpticalCalibration_LOADED)
add_executable(AtmosphericCorrectionSequencement AtmosphericCorrectionSequencement.cxx)
target_link_libraries(AtmosphericCorrectionSequencement ${OTB_LIBRARIES})
endif()
add_executable(AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx)
target_link_libraries(AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter ${OTB_LIBRARIES})
......
......@@ -52,6 +52,7 @@ otb_add_test(NAME raTeNDVIRAndNIRVegetationIndexImageFilterTest COMMAND ${OTB_TE
${TEMP}/NDVIRAndNIRVegetationIndex4.tif
)
if(OTBOpticalCalibration_LOADED)
otb_add_test(NAME raTeAtmosphericCorrectionSequencementTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${EPSILON_8}
${BASELINE}/Example_RomaniaAtmosphericCorrectionSequencement.tif
......@@ -82,3 +83,4 @@ otb_add_test(NAME raTeAtmosphericCorrectionSequencementTest COMMAND ${OTB_TEST_D
2 # Radius;
0.020 # pixel spacing in kilometers
)
endif()
\ No newline at end of file
......@@ -24,8 +24,10 @@ target_link_libraries(OtsuMultipleThresholdImageFilter ${OTB_LIBRARIES})
add_executable(OtsuThresholdImageFilter OtsuThresholdImageFilter.cxx)
target_link_libraries(OtsuThresholdImageFilter ${OTB_LIBRARIES})
if(OTBMeanShift_LOADED)
add_executable(StreamingMeanShiftSegmentation StreamingMeanShiftSegmentation.cxx)
target_link_libraries(StreamingMeanShiftSegmentation ${OTB_LIBRARIES})
endif()
add_executable(VectorConfidenceConnected VectorConfidenceConnected.cxx)
target_link_libraries(VectorConfidenceConnected ${OTB_LIBRARIES})
......
......@@ -272,7 +272,7 @@ otb_add_test(NAME seTeLabelizeNeighborhoodConnectedImageFilterTest COMMAND ${OTB
# ------- StreamingMeanShiftSegmentationTest ----------
if(OTBMeanShift_LOADED)
otb_add_test(NAME seTeStreamingMeanShiftSegmentationTest COMMAND ${OTB_TEST_DRIVER}
# --compare-ogr ${NOTOL}
# ${BASELINE_FILES}/seTeStreamingMeanShiftSegmentationTest.shp
......@@ -291,3 +291,4 @@ otb_add_test(NAME seTeStreamingMeanShiftSegmentationTest COMMAND ${OTB_TEST_DRIV
1 #Simplify Flag
0.2 #Simplification tolerance
)
endif()
\ No newline at end of file
project(SimulationExamples)
if(OTBSimulation_LOADED)
add_executable(LAIAndPROSAILToSensorResponse LAIAndPROSAILToSensorResponse.cxx)
target_link_libraries(LAIAndPROSAILToSensorResponse ${OTB_LIBRARIES})
add_executable(LAIFromNDVIImageTransform LAIFromNDVIImageTransform.cxx)
target_link_libraries(LAIFromNDVIImageTransform ${OTB_LIBRARIES})
add_executable(ProsailModel ProsailModel.cxx)
target_link_libraries(ProsailModel ${OTB_LIBRARIES})
endif()
add_executable(LAIFromNDVIImageTransform LAIFromNDVIImageTransform.cxx)
target_link_libraries(LAIFromNDVIImageTransform ${OTB_LIBRARIES})
if(BUILD_TESTING)
add_subdirectory(test)
......
......@@ -3,6 +3,7 @@ set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
# ------- ProsailModelExampleTest ----------
if(OTBSimulation_LOADED)
otb_add_test(NAME siTvProsailModelExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-ascii ${EPSILON_3}
${BASELINE}/siTvProsailModelExampleTest.txt
......@@ -25,20 +26,6 @@ otb_add_test(NAME siTvProsailModelExampleTest COMMAND ${OTB_TEST_DRIVER}
${TEMP}/siTvProsailModelExampleTest.txt
)
otb_add_test(NAME siTvLAIFromNDVIImageTransfromExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${EPSILON_8}
${OTB_DATA_ROOT}/Baseline/OTB/Images/raRAndNIRVegetationIndex_LAIFromNDVIFormosat2_verySmallFSATSWcRcNir.tif
${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW.tif
Execute $<TARGET_FILE:LAIFromNDVIImageTransform>
${INPUTDATA}/verySmallFSATSW.tif
${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW.tif
${TEMP}/verySmallFSATSW_visu.png
${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW_visu.png
1 # red
4 # nir
)
otb_add_test(NAME siTvLAIAndPROSAILToSensorResponseExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${EPSILON_8}
${OTBAPP_BASELINE}/siTvLAIAndPROSAILToSensorResponseSmall.tif
......@@ -54,3 +41,18 @@ Execute $<TARGET_FILE:LAIAndPROSAILToSensorResponse>
5
${OTB_DATA_ROOT}/Input/
)
endif()
otb_add_test(NAME siTvLAIFromNDVIImageTransfromExampleTest COMMAND ${OTB_TEST_DRIVER}
--compare-image ${EPSILON_8}
${OTB_DATA_ROOT}/Baseline/OTB/Images/raRAndNIRVegetationIndex_LAIFromNDVIFormosat2_verySmallFSATSWcRcNir.tif
${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW.tif
Execute $<TARGET_FILE:LAIFromNDVIImageTransform>
${INPUTDATA}/verySmallFSATSW.tif
${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW.tif
${TEMP}/verySmallFSATSW_visu.png
${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW_visu.png
1 # red
4 # nir
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment