diff --git a/Applications/ChangeDetection/CMakeLists.txt b/Applications/ChangeDetection/CMakeLists.txt index 294e63605e9f2fd6ee95105552fd7c8d5413e012..a5d8e3b67e7cbed8f51066c6d1163182dea78732 100644 --- a/Applications/ChangeDetection/CMakeLists.txt +++ b/Applications/ChangeDetection/CMakeLists.txt @@ -2,3 +2,10 @@ OTB_CREATE_APPLICATION(NAME MultivariateAlterationDetector SOURCES otbMultivariateAlterationDetector.cxx LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters) + + +OTB_CREATE_APPLICATION(NAME MaximumAutocorrelationFactor + SOURCES otbMaximumAutocorrelationFactor.cxx + LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters) + + diff --git a/Applications/ChangeDetection/otbMaximumAutocorrelationFactor.cxx b/Applications/ChangeDetection/otbMaximumAutocorrelationFactor.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0b42e404264f4d0db090bfd967cff4c57f911c75 --- /dev/null +++ b/Applications/ChangeDetection/otbMaximumAutocorrelationFactor.cxx @@ -0,0 +1,84 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "otbWrapperApplication.h" +#include "otbWrapperApplicationFactory.h" + +#include "otbMaximumAutocorrelationFactorImageFilter.h" + +namespace otb +{ +namespace Wrapper +{ + +class MaximumAutocorrelationFactor: public Application +{ +public: + /** Standard class typedefs. */ + typedef MaximumAutocorrelationFactor Self; + typedef Application Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Standard macro */ + itkNewMacro(Self); + + itkTypeMacro(MaximumAutocorrelationFactor, otb::Wrapper::Application); + +private: + MaximumAutocorrelationFactor() + { + SetName("MaximumAutocorrelationFactor"); + SetDescription("Maximum autocorrelation factor"); + } + + virtual ~MaximumAutocorrelationFactor() + { + } + + void DoCreateParameters() + { + AddParameter(ParameterType_InputImage, "in", "Input Image 1"); + AddParameter(ParameterType_OutputImage, "out", "Change Map"); + } + + void DoUpdateParameters() + { + } + + void DoExecute() + { + typedef otb::MaximumAutocorrelationFactorImageFilter< + FloatVectorImageType, + FloatVectorImageType> MAFFilterType; + + MAFFilterType::Pointer changeFilter = MAFFilterType::New(); + + changeFilter->SetInput(GetParameterImage("in")); + m_Ref = changeFilter; + + SetParameterOutputImage("out", changeFilter->GetOutput()); + } + + itk::LightObject::Pointer m_Ref; + +}; + +} +} + +OTB_APPLICATION_EXPORT(otb::Wrapper::MaximumAutocorrelationFactor) diff --git a/Testing/Applications/ChangeDetection/CMakeLists.txt b/Testing/Applications/ChangeDetection/CMakeLists.txt index cd55b42f23523197e28d24576812383cbcb9e0f1..f32e6708b28ed808f66880ee38502a8e0bce660a 100644 --- a/Testing/Applications/ChangeDetection/CMakeLists.txt +++ b/Testing/Applications/ChangeDetection/CMakeLists.txt @@ -12,3 +12,18 @@ add_test(NAME apTvChMultivariateAlterationDetector --in1 ${INPUTDATA}/Spot5-Gloucester-before.tif --in2 ${INPUTDATA}/Spot5-Gloucester-after.tif --out ${TEMP}/apTvChMultivariateAlterationDetectorSameNbBands.tif ) + + +#--- MaximumAutocorrelationFactor ---# + +add_test(NAME apTvChMaximumAutocorrelationFactor + COMMAND otbTestDriver + --compare-image 0.025 + ${BASELINE}/bfTvMaximumAutocorrelationFactorImageFilterOutput.tif + ${TEMP}/apTvChMaximumAutocorrelationFactor.tif + Execute $<TARGET_FILE:otbApplicationLauncherCommandLine> + MaximumAutocorrelationFactor + $<TARGET_FILE_DIR:otbapp_MaximumAutocorrelationFactor> + --in ${INPUTDATA}/cupriteSubHsi.tif + --out ${TEMP}/apTvChMaximumAutocorrelationFactor.tif ) +