OTB  9.0.0
Orfeo Toolbox
otbFourierMellinDescriptorsImageFunction.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbFourierMellinDescriptorsImageFunction_h
22 #define otbFourierMellinDescriptorsImageFunction_h
23 
24 #include "itkImageFunction.h"
25 
26 #include "otbImage.h"
27 
28 #include "otbMath.h"
29 #include <complex>
30 
31 namespace otb
32 {
33 
61 
62 template <class TInputImage, class TCoordRep = double>
64  : public itk::ImageFunction<TInputImage, std::vector<std::vector<typename itk::NumericTraits<typename TInputImage::PixelType>::RealType>>, TCoordRep>
65 {
66 public:
69  typedef itk::ImageFunction<TInputImage, std::vector<std::vector<typename itk::NumericTraits<typename TInputImage::PixelType>::RealType>>, TCoordRep>
71  typedef itk::SmartPointer<Self> Pointer;
72  typedef itk::SmartPointer<const Self> ConstPointer;
73 
75  itkTypeMacro(FourierMellinDescriptorsImageFunction, ImageFunction);
76 
78  itkNewMacro(Self);
79 
81  typedef TInputImage InputImageType;
82  typedef typename Superclass::IndexType IndexType;
83  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
84  typedef typename Superclass::PointType PointType;
85  typedef typename Superclass::OutputType OutputType;
86 
87  typedef double ScalarRealType;
88  typedef typename std::complex<ScalarRealType> ScalarComplexType;
89  typedef typename std::vector<std::vector<ScalarComplexType>> ComplexType;
90 
91  typedef TCoordRep CoordRepType;
92 
94  itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
95 
97  OutputType EvaluateAtIndex(const IndexType& index) const override;
98 
100  OutputType Evaluate(const PointType& point) const override
101  {
102  IndexType index;
103  this->ConvertPointToNearestIndex(point, index);
104  return this->EvaluateAtIndex(index);
105  }
107  {
108  IndexType index;
109  this->ConvertContinuousIndexToNearestIndex(cindex, index);
110  return this->EvaluateAtIndex(index);
111  }
113 
117  itkSetMacro(NeighborhoodRadius, unsigned int);
118  itkGetConstReferenceMacro(NeighborhoodRadius, unsigned int);
120 
121  itkSetMacro(Pmax, unsigned int);
122  itkGetConstReferenceMacro(Pmax, unsigned int);
123  itkSetMacro(Qmax, unsigned int);
124  itkGetConstReferenceMacro(Qmax, unsigned int);
125 
126 protected:
129  {
130  }
131  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
132 
133 private:
134  FourierMellinDescriptorsImageFunction(const Self&) = delete;
135  void operator=(const Self&) = delete;
136 
137  unsigned int m_Pmax;
138  unsigned int m_Qmax;
139  unsigned int m_NeighborhoodRadius;
140  double m_Sigma;
141 };
142 
143 } // namespace otb
144 
145 #ifndef OTB_MANUAL_INSTANTIATION
147 #endif
148 
149 #endif
otb::FourierMellinDescriptorsImageFunction::PointType
Superclass::PointType PointType
Definition: otbFourierMellinDescriptorsImageFunction.h:84
otb::FourierMellinDescriptorsImageFunction::m_Qmax
unsigned int m_Qmax
Definition: otbFourierMellinDescriptorsImageFunction.h:138
otbImage.h
otb::FourierMellinDescriptorsImageFunction::ScalarComplexType
std::complex< ScalarRealType > ScalarComplexType
Definition: otbFourierMellinDescriptorsImageFunction.h:88
otb::FourierMellinDescriptorsImageFunction::Evaluate
OutputType Evaluate(const PointType &point) const override
Definition: otbFourierMellinDescriptorsImageFunction.h:100
otbMath.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::FourierMellinDescriptorsImageFunction::Self
FourierMellinDescriptorsImageFunction Self
Definition: otbFourierMellinDescriptorsImageFunction.h:68
otb::FourierMellinDescriptorsImageFunction::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbFourierMellinDescriptorsImageFunction.h:71
otb::FourierMellinDescriptorsImageFunction
Calculate the Fourier-Mellin descriptors in the specified neighborhood.
Definition: otbFourierMellinDescriptorsImageFunction.h:63
otb::FourierMellinDescriptorsImageFunction::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbFourierMellinDescriptorsImageFunction.h:72
otb::FourierMellinDescriptorsImageFunction::CoordRepType
TCoordRep CoordRepType
Definition: otbFourierMellinDescriptorsImageFunction.h:91
otb::FourierMellinDescriptorsImageFunction::~FourierMellinDescriptorsImageFunction
~FourierMellinDescriptorsImageFunction() override
Definition: otbFourierMellinDescriptorsImageFunction.h:128
otb::FourierMellinDescriptorsImageFunction::ComplexType
std::vector< std::vector< ScalarComplexType > > ComplexType
Definition: otbFourierMellinDescriptorsImageFunction.h:89
otb::FourierMellinDescriptorsImageFunction::Superclass
itk::ImageFunction< TInputImage, std::vector< std::vector< typename itk::NumericTraits< typename TInputImage::PixelType >::RealType > >, TCoordRep > Superclass
Definition: otbFourierMellinDescriptorsImageFunction.h:70
otb::FourierMellinDescriptorsImageFunction::m_NeighborhoodRadius
unsigned int m_NeighborhoodRadius
Definition: otbFourierMellinDescriptorsImageFunction.h:139
otb::FourierMellinDescriptorsImageFunction::EvaluateAtContinuousIndex
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
Definition: otbFourierMellinDescriptorsImageFunction.h:106
otb::FourierMellinDescriptorsImageFunction::IndexType
Superclass::IndexType IndexType
Definition: otbFourierMellinDescriptorsImageFunction.h:82
otbFourierMellinDescriptorsImageFunction.hxx
otb::FourierMellinDescriptorsImageFunction::ScalarRealType
double ScalarRealType
Definition: otbFourierMellinDescriptorsImageFunction.h:87
otb::FourierMellinDescriptorsImageFunction::m_Pmax
unsigned int m_Pmax
Definition: otbFourierMellinDescriptorsImageFunction.h:137
otb::FourierMellinDescriptorsImageFunction::m_Sigma
double m_Sigma
Definition: otbFourierMellinDescriptorsImageFunction.h:140
otb::FourierMellinDescriptorsImageFunction::InputImageType
TInputImage InputImageType
Definition: otbFourierMellinDescriptorsImageFunction.h:78
otb::FourierMellinDescriptorsImageFunction::ContinuousIndexType
Superclass::ContinuousIndexType ContinuousIndexType
Definition: otbFourierMellinDescriptorsImageFunction.h:83
otb::FourierMellinDescriptorsImageFunction::OutputType
Superclass::OutputType OutputType
Definition: otbFourierMellinDescriptorsImageFunction.h:85