diff --git a/Code/BasicFilters/otbPointSetToDensityImageFilter.h b/Code/BasicFilters/otbPointSetToDensityImageFilter.h new file mode 100644 index 0000000000000000000000000000000000000000..f6c224f1f46a3ea4a0b25d1b61fdc6034ee8cdd4 --- /dev/null +++ b/Code/BasicFilters/otbPointSetToDensityImageFilter.h @@ -0,0 +1,109 @@ +/*========================================================================= + +Program: ORFEO Toolbox +Language: C++ +Date: $Date$ +Version: $Revision$ + + +Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. +See OTBCopyright.txt for details. + +Copyright (c) CS Systemes d'information. All rights reserved. +See CSCopyright.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. + +=========================================================================*/ +#ifndef __otbPointSetToDensityImageFilter_h +#define __otbPointSetToDensityImageFilter_h + +#include "itkProcessObject.h" +#include "itkPointSet.h" +#include "itkPointSetToImageFilter.h" + + +/** \class PointSetToDensityImageFilter + * \brief This class extracts key points from an image through a pyramidal gaussian based decomposition + * + * This class implements the SURF Key point detector proposed by Tuytelaars and Vangool from the university + * of Leuven, 2005 + * + * \li Gaussian Second order derivative Hessian images are computed in each + * level and each octave for the input image. + * \li For each octave, an extremum search is launched on each 3 adjacent scales. + * \li The Key points detected are the ones extremum in the current , previous and + * next scale of reserach. 3 scales are needed for the computation (NumberOfScales >=3). + * \li Orientation and descriptors are computed for each key point detected. + * + * Selected Key Points are stored in an itk::PointSet structure. + * Points contains the coordinate of the detected point. + * DataPoints contain the values of the 64 element descriptor for each key point + * detected through the pyramidal analysis. + * + * Orientation is expressed in degree in the range of [0,360] + * + * \sa otb::ImageToDeterminantHessianImage + */ + +namespace otb +{ + template <class TInputPointSet , class TOutputImage> + class ITK_EXPORT PointSetToDensityImageFilter + : public itk::PointSetToImageFilter<TInputPointSet, TOutputImage > + { + + public: + + /** Standard class typedefs. */ + typedef PointSetToDensityImageFilter Self; + typedef itk::PointSetToImageFilter<TInputPointSet, TOutputImage> Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Method for creation through the object factory. */ + itkNewMacro(Self); + + /** Run-time type information (and related methods). */ + itkTypeMacro(PointSetToDensityImageFilter,itk::PointSetToImageFilter); + + + /** Template parameters typedefs*/ + + + + protected: + + /** + * Constructor. + */ + PointSetToDensityImageFilter(); + /** + * Destructor. + */ + virtual ~PointSetToDensityImageFilter(); + /** + * Standard PrintSelf method. + */ + virtual void PrintSelf(std::ostream& os, itk::Indent indent) const; + /** + * Main computation method. + */ + virtual void GenerateData(); + + private: + + PointSetToDensityImageFilter(const Self&); //purposely not implemented + void operator=(const Self&); //purposely not implemented + + }; +} +#ifndef OTB_MANUAL_INSTANTIATION +#include "otbPointSetToDensityImageFilter.txx" +#endif + +#endif + + diff --git a/Code/BasicFilters/otbPointSetToDensityImageFilter.txx b/Code/BasicFilters/otbPointSetToDensityImageFilter.txx new file mode 100644 index 0000000000000000000000000000000000000000..a9c2353b2a5d95aed7b3eec9ec65832014b39b7d --- /dev/null +++ b/Code/BasicFilters/otbPointSetToDensityImageFilter.txx @@ -0,0 +1,66 @@ +/*========================================================================= + +Program: ORFEO Toolbox +Language: C++ +Date: $Date$ +Version: $Revision$ + + +Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. +See OTBCopyright.txt for details. + +Copyright (c) CS systèmes d'information. All rights reserved. +See CSCopyright.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 "otbPointSetToDensityImageFilter.h" + + +namespace otb +{ + /**--------------------------------------------------------- + * Constructor + ----------------------------------------------------------*/ + template <class TInputPointSet , class TOutputImage > + PointSetToDensityImageFilter< TInputPointSet , TOutputImage > + ::PointSetToDensityImageFilter() + { + } + + + /*--------------------------------------------------------- + * Destructor.c + ----------------------------------------------------------*/ + template <class TInputPointSet , class TOutputImage > + PointSetToDensityImageFilter< TInputPointSet , TOutputImage > + ::~PointSetToDensityImageFilter() + {} + + /*------------------------------------------------------- + * Generate Data + --------------------------------------------------------*/ + template <class TInputPointSet , class TOutputImage > + void + PointSetToDensityImageFilter< TInputPointSet , TOutputImage> + ::GenerateData(void) + { + + + }/** End of GenerateData()*/ + + /*---------------------------------------------------------------- + PrintSelf + -----------------------------------------------------------------*/ + template <class TInputPointSet , class TOutputImage > + void + PointSetToDensityImageFilter< TInputPointSet , TOutputImage > + ::PrintSelf(std::ostream& os, itk::Indent indent) const + { + Superclass::PrintSelf(os, indent); + } +} diff --git a/Testing/Code/BasicFilters/CMakeLists.txt b/Testing/Code/BasicFilters/CMakeLists.txt index 805f14ab1425e7f0147194c260ce8b8fb7717595..fdf2a941f95a7a38fa8b9b76039d9eecea08eecc 100644 --- a/Testing/Code/BasicFilters/CMakeLists.txt +++ b/Testing/Code/BasicFilters/CMakeLists.txt @@ -1122,6 +1122,13 @@ ADD_TEST(bfTuPointSetFunctionNew ${BASICFILTERS_TESTS11} ) + +# ------- otbPointSetDensityFunction ---------------------------- +ADD_TEST(bfTuPointSetDensityFunctionNew ${BASICFILTERS_TESTS11} + otbPointSetDensityFunctionNew + ) + + ADD_TEST(bfTvPointSetDensityFunctionTest ${BASICFILTERS_TESTS11} --compare-ascii ${TOL} ${BASELINE_FILES}/bfTvPointSetDensityFunctionOutputAscii.txt diff --git a/Testing/Code/BasicFilters/otbBasicFiltersTests11.cxx b/Testing/Code/BasicFilters/otbBasicFiltersTests11.cxx index 2cd95eda85abedac1f71bc6c443298e2d7ad0ca4..ece89b214b2b310348896fa888d92a5fd3c9d805 100644 --- a/Testing/Code/BasicFilters/otbBasicFiltersTests11.cxx +++ b/Testing/Code/BasicFilters/otbBasicFiltersTests11.cxx @@ -29,10 +29,9 @@ void RegisterTests() { REGISTER_TEST(otbExtractROIResample); REGISTER_TEST(otbPointSetFunctionNew); -REGISTER_TEST(otbPointSetToDensityImageFilterNew); REGISTER_TEST(otbPointSetDensityFunctionNew); REGISTER_TEST(otbPointSetDensityFunctionTest); - +REGISTER_TEST(otbPointSetToDensityImageFilterNew); //REGISTER_TEST(otbCountImageFunctionTest); //REGISTER_TEST(otbCountImageFilterNew); //REGISTER_TEST(otbCountImageFilterTest); diff --git a/Testing/Code/BasicFilters/otbPointSetToDensityImageFilterNew.cxx b/Testing/Code/BasicFilters/otbPointSetToDensityImageFilterNew.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e96a5945c4329d8b4bd51829bbc7ce06184aaf5b --- /dev/null +++ b/Testing/Code/BasicFilters/otbPointSetToDensityImageFilterNew.cxx @@ -0,0 +1,43 @@ +/*========================================================================= + +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 <stdio.h> +#include "otbImage.h" +#include "otbPointSetToDensityImageFilter.h" +#include "itkPointSet.h" +#include "itkVariableLengthVector.h" + + +int otbPointSetToDensityImageFilterNew(int, char* [] ) +{ + + const unsigned int Dimension = 2; + typedef float PixelType; + + typedef otb::Image<PixelType , Dimension> ImageType; + typedef itk::VariableLengthVector<PixelType> RealVectorType; + typedef itk::PointSet<RealVectorType,Dimension> PointSetType; + typedef otb::PointSetToDensityImageFilter <PointSetType,ImageType> FunctionType; + + /**Instancitation of an object*/ + + FunctionType::Pointer filter = FunctionType::New(); + + return EXIT_SUCCESS; +} +