diff --git a/Applications/CMakeLists.txt b/Applications/CMakeLists.txt index 9f56b20aa0b03b2247294114e9daaabc6697341f..fe39ec6746d2caea617516e3b3cd7de12eed7dd9 100644 --- a/Applications/CMakeLists.txt +++ b/Applications/CMakeLists.txt @@ -4,6 +4,7 @@ include(OTBWrapperMacros) # usefull for batch testing set(OTB_APPLICATIONS_NAME_LIST "" CACHE STRING "List of all applications name" FORCE) +add_subdirectory(ChangeDetection) add_subdirectory(Classification) add_subdirectory(FeatureExtraction) add_subdirectory(Hyperspectral) diff --git a/Applications/ChangeDetection/CMakeLists.txt b/Applications/ChangeDetection/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..294e63605e9f2fd6ee95105552fd7c8d5413e012 --- /dev/null +++ b/Applications/ChangeDetection/CMakeLists.txt @@ -0,0 +1,4 @@ + +OTB_CREATE_APPLICATION(NAME MultivariateAlterationDetector + SOURCES otbMultivariateAlterationDetector.cxx + LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters) diff --git a/Applications/ChangeDetection/otbMultivariateAlterationDetector.cxx b/Applications/ChangeDetection/otbMultivariateAlterationDetector.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5ae423ee0b1a1e61407a16c5585ccbb30800ab06 --- /dev/null +++ b/Applications/ChangeDetection/otbMultivariateAlterationDetector.cxx @@ -0,0 +1,87 @@ +/*========================================================================= + + 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 "otbMultivariateAlterationDetectorImageFilter.h" + +namespace otb +{ +namespace Wrapper +{ + +class MultivariateAlterationDetector: public Application +{ +public: + /** Standard class typedefs. */ + typedef MultivariateAlterationDetector Self; + typedef Application Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Standard macro */ + itkNewMacro(Self); + + itkTypeMacro(MultivariateAlterationDetector, otb::Wrapper::Application); + +private: + MultivariateAlterationDetector() + { + SetName("MultivariateAlterationDetector"); + SetDescription("Multivariate Alteration Detector"); + } + + virtual ~MultivariateAlterationDetector() + { + } + + void DoCreateParameters() + { + AddParameter(ParameterType_InputImage, "in1", "Input Image 1"); + AddParameter(ParameterType_InputImage, "in2", "Input Image 2"); + AddParameter(ParameterType_OutputImage, "out", "Change Map"); + } + + void DoUpdateParameters() + { + } + + void DoExecute() + { + typedef otb::MultivariateAlterationDetectorImageFilter< + FloatVectorImageType, + FloatVectorImageType> ChangeFilterType; + + ChangeFilterType::Pointer changeFilter = ChangeFilterType::New(); + + changeFilter->SetInput1(GetParameterImage("in1")); + changeFilter->SetInput2(GetParameterImage("in2")); + + m_Ref = changeFilter; + + SetParameterOutputImage("out", changeFilter->GetOutput()); + } + + itk::LightObject::Pointer m_Ref; + +}; + +} +} + +OTB_APPLICATION_EXPORT(otb::Wrapper::MultivariateAlterationDetector)