OTB  9.0.0
Orfeo Toolbox
otbHarrisImageFilter.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 otbHarrisImageFilter_h
22 #define otbHarrisImageFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "itkHessianRecursiveGaussianImageFilter.h"
28 #include "otbMath.h"
29 
30 namespace otb
31 {
32 
55 template <class TInputImage, class TOutputImage>
56 class HarrisImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
57 {
58 public:
59  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
60  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
61 
62  typedef TInputImage InputImageType;
63  typedef TOutputImage OutputImageType;
64 
66  typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass;
67  typedef itk::SmartPointer<Self> Pointer;
68  typedef itk::SmartPointer<const Self> ConstPointer;
69 
70  itkNewMacro(Self);
71 
72  itkTypeMacro(HarrisImageFilter, ImageToImageFilter);
73 
74  typedef typename InputImageType::PixelType InputPixelType;
75  typedef typename InputImageType::SizeType SizeType;
76 
77  typedef typename OutputImageType::PixelType OutputPixelType;
78 
79  // typedef typename InputImageType::SizeType SizeType;
80 
81  typedef itk::Image<itk::SymmetricSecondRankTensor<typename itk::NumericTraits<InputPixelType>::RealType, InputImageDimension>, InputImageDimension>
83 
84  typedef itk::HessianRecursiveGaussianImageFilter<InputImageType, TensorType> HessianFilterType;
85 
86  typedef itk::RecursiveGaussianImageFilter<TensorType, TensorType> GaussianFilterType;
89 
90  itkSetMacro(SigmaD, double);
91  itkGetConstReferenceMacro(SigmaD, double);
92  itkSetMacro(SigmaI, double);
93  itkGetConstReferenceMacro(SigmaI, double);
94  itkSetMacro(Alpha, double);
95  itkGetConstReferenceMacro(Alpha, double);
96 
97 protected:
99  ~HarrisImageFilter() override
100  {
101  }
102 
103  void GenerateData() override;
104 
105  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
106 
107 private:
108  HarrisImageFilter(const Self&) = delete;
109  void operator=(const Self&) = delete;
110 
111  double m_SigmaD;
112  double m_SigmaI;
113  double m_Alpha;
114 
115  typename HessianFilterType::Pointer m_HessianFilter;
116  typename GaussianFilterType::Pointer m_GaussianFilter0;
117  typename GaussianFilterType::Pointer m_GaussianFilter1;
120 };
121 } // end namespace otb
122 
123 #ifndef OTB_MANUAL_INSTANTIATION
124 #include "otbHarrisImageFilter.hxx"
125 #endif
126 
127 #endif
otbHarrisImageFilter.hxx
otb::HarrisImageFilter::m_GaussianFilter1
GaussianFilterType::Pointer m_GaussianFilter1
Definition: otbHarrisImageFilter.h:117
otbMultiplyByScalarImageFilter.h
otb::HarrisImageFilter::Self
HarrisImageFilter Self
Definition: otbHarrisImageFilter.h:65
otb::HarrisImageFilter::GenerateData
void GenerateData() override
Definition: otbHarrisImageFilter.hxx:47
otbHessianToScalarImageFilter.h
otb::HarrisImageFilter::HessianFilterType
itk::HessianRecursiveGaussianImageFilter< InputImageType, TensorType > HessianFilterType
Definition: otbHarrisImageFilter.h:84
otbMath.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::HarrisImageFilter::HarrisImageFilter
HarrisImageFilter()
Definition: otbHarrisImageFilter.hxx:33
otb::HarrisImageFilter::m_Alpha
double m_Alpha
Definition: otbHarrisImageFilter.h:113
otb::HarrisImageFilter::m_MultiplyScalarFilter
MultiplyScalarFilterType::Pointer m_MultiplyScalarFilter
Definition: otbHarrisImageFilter.h:119
otb::HarrisImageFilter::InputImageDimension
static const unsigned int InputImageDimension
Definition: otbHarrisImageFilter.h:59
otb::HarrisImageFilter::m_HessianFilter
HessianFilterType::Pointer m_HessianFilter
Definition: otbHarrisImageFilter.h:115
otb::HarrisImageFilter::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbHarrisImageFilter.hxx:79
otb::HarrisImageFilter::operator=
void operator=(const Self &)=delete
otb::HarrisImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbHarrisImageFilter.h:67
otb::MultiplyByScalarImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMultiplyByScalarImageFilter.h:83
otb::HarrisImageFilter
This filter performs the computation of the Harris measure as followed.
Definition: otbHarrisImageFilter.h:56
otb::MultiplyByScalarImageFilter
TODO.
Definition: otbMultiplyByScalarImageFilter.h:73
otb::HarrisImageFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbHarrisImageFilter.h:72
otb::HarrisImageFilter::~HarrisImageFilter
~HarrisImageFilter() override
Definition: otbHarrisImageFilter.h:99
otb::HarrisImageFilter::MultiplyScalarFilterType
otb::MultiplyByScalarImageFilter< OutputImageType, OutputImageType > MultiplyScalarFilterType
Definition: otbHarrisImageFilter.h:88
otb::HarrisImageFilter::m_GaussianFilter0
GaussianFilterType::Pointer m_GaussianFilter0
Definition: otbHarrisImageFilter.h:116
otb::HarrisImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbHarrisImageFilter.h:68
otb::HarrisImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbHarrisImageFilter.h:63
otb::HarrisImageFilter::m_SigmaI
double m_SigmaI
Definition: otbHarrisImageFilter.h:112
otb::HarrisImageFilter::m_SigmaD
double m_SigmaD
Definition: otbHarrisImageFilter.h:111
otb::HarrisImageFilter::Superclass
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass
Definition: otbHarrisImageFilter.h:66
otb::HarrisImageFilter::OutputImageDimension
static const unsigned int OutputImageDimension
Definition: otbHarrisImageFilter.h:60
otb::HessianToScalarImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbHessianToScalarImageFilter.h:89
otb::HessianToScalarImageFilter
TODO.
Definition: otbHessianToScalarImageFilter.h:79
otb::HarrisImageFilter::InputImageType
TInputImage InputImageType
Definition: otbHarrisImageFilter.h:62
otb::HarrisImageFilter::m_HessianToScalarFilter
HessianToScalarFilterType::Pointer m_HessianToScalarFilter
Definition: otbHarrisImageFilter.h:118
otb::HarrisImageFilter::OutputPixelType
OutputImageType::PixelType OutputPixelType
Definition: otbHarrisImageFilter.h:77
otb::HarrisImageFilter::GaussianFilterType
itk::RecursiveGaussianImageFilter< TensorType, TensorType > GaussianFilterType
Definition: otbHarrisImageFilter.h:86
otb::HarrisImageFilter::TensorType
itk::Image< itk::SymmetricSecondRankTensor< typename itk::NumericTraits< InputPixelType >::RealType, InputImageDimension >, InputImageDimension > TensorType
Definition: otbHarrisImageFilter.h:82
otb::HarrisImageFilter::SizeType
InputImageType::SizeType SizeType
Definition: otbHarrisImageFilter.h:75
otb::HarrisImageFilter::HessianToScalarFilterType
otb::HessianToScalarImageFilter< TensorType, OutputImageType > HessianToScalarFilterType
Definition: otbHarrisImageFilter.h:87