OTB  10.0.0
Orfeo Toolbox
otbHarrisImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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
This filter performs the computation of the Harris measure as followed.
HarrisImageFilter(const Self &)=delete
itk::SmartPointer< const Self > ConstPointer
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass
static const unsigned int InputImageDimension
GaussianFilterType::Pointer m_GaussianFilter1
HessianFilterType::Pointer m_HessianFilter
otb::MultiplyByScalarImageFilter< OutputImageType, OutputImageType > MultiplyScalarFilterType
HessianToScalarFilterType::Pointer m_HessianToScalarFilter
void PrintSelf(std::ostream &os, itk::Indent indent) const override
OutputImageType::PixelType OutputPixelType
itk::SmartPointer< Self > Pointer
MultiplyScalarFilterType::Pointer m_MultiplyScalarFilter
GaussianFilterType::Pointer m_GaussianFilter0
itk::RecursiveGaussianImageFilter< TensorType, TensorType > GaussianFilterType
InputImageType::PixelType InputPixelType
otb::HessianToScalarImageFilter< TensorType, OutputImageType > HessianToScalarFilterType
InputImageType::SizeType SizeType
void operator=(const Self &)=delete
static const unsigned int OutputImageDimension
itk::HessianRecursiveGaussianImageFilter< InputImageType, TensorType > HessianFilterType
itk::Image< itk::SymmetricSecondRankTensor< typename itk::NumericTraits< InputPixelType >::RealType, InputImageDimension >, InputImageDimension > TensorType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.