OTB  9.0.0
Orfeo Toolbox
otbImageToSURFKeyPointSetFilter.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 otbImageToSURFKeyPointSetFilter_h
22 #define otbImageToSURFKeyPointSetFilter_h
23 
24 #include "itkConstNeighborhoodIterator.h"
26 #include "itkPointSet.h"
27 #include <itkRescaleIntensityImageFilter.h>
28 #include <otbImageList.h>
29 #include "itkResampleImageFilter.h"
31 #include "itkVector.h"
32 
33 namespace otb
34 {
35 
61 template <class TInputImage, class TOutputPointSet>
62 class ITK_EXPORT ImageToSURFKeyPointSetFilter : public ImageToPointSetFilter<TInputImage, TOutputPointSet>
63 {
64 
65 public:
69  typedef itk::SmartPointer<Self> Pointer;
70  typedef itk::SmartPointer<const Self> ConstPointer;
71 
73  itkNewMacro(Self);
74 
77 
79  typedef TInputImage InputImageType;
80  typedef typename InputImageType::Pointer InputImagePointerType;
81  typedef typename InputImageType::IndexType PixelIndex;
82  typedef typename InputImageType::IndexType IndexType;
83  typedef typename InputImageType::PixelType PixelValue;
84  typedef typename InputImageType::SpacingType SpacingType;
85  typedef typename InputImageType::SizeType SizeType;
86  typedef typename InputImageType::PointType PointImageType;
87 
88  typedef TOutputPointSet OutputPointSetType;
89  typedef typename TOutputPointSet::Pointer OutputPointSetPointerType;
90  typedef typename TOutputPointSet::PixelType OutputPixelType;
91  typedef typename TOutputPointSet::PointType OutputPointType;
92  typedef typename TOutputPointSet::PointIdentifier OutputPointIdentifierType;
93 
95  itkSetMacro(OctavesNumber, int);
96  itkGetMacro(OctavesNumber, int);
98 
100  itkSetMacro(ScalesNumber, int);
101  itkGetMacro(ScalesNumber, int);
103 
105  itkGetMacro(NumberOfPoints, int);
106 
108  typedef itk::ConstNeighborhoodIterator<InputImageType> NeighborhoodIteratorType;
109  typedef typename NeighborhoodIteratorType::NeighborhoodType NeighborhoodType;
110  typedef typename NeighborhoodType::OffsetType OffsetType;
111 
114 
116  typedef itk::ResampleImageFilter<InputImageType, InputImageType> ResampleFilterType;
117  typedef typename ResampleFilterType::Pointer ResampleFilterPointerType;
118 
122 
124  typedef std::vector<double> VectorType;
125  typedef itk::Vector<PixelValue, 3> VectorPointType;
126 
127 protected:
132 
136  ~ImageToSURFKeyPointSetFilter() override;
137 
141  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
142 
146  void GenerateData() override;
147 
154  virtual bool IsLocalExtremum(const NeighborhoodType& neigh);
155 
163  virtual bool IsLocalExtremumAround(const NeighborhoodType& neigh, double CenterValue);
164 
177  bool RefineLocationKeyPoint(const NeighborhoodIteratorType& currentScale, const NeighborhoodIteratorType& previousScale,
178  const NeighborhoodIteratorType& nextScale, VectorPointType& solution);
179 
187  virtual double AssignOrientation(const NeighborhoodType& neigh, double S);
188 
197  virtual VectorType ComputeDescriptor(const NeighborhoodType& neigh, double O, double S);
198 
202  virtual int GetMin(int a, int b, int c);
203 
204 private:
205  ImageToSURFKeyPointSetFilter(const Self&) = delete;
206  void operator=(const Self&) = delete;
207 
210 
213 
216 
219 
225 
228 
229  /*Resample Filter*/
231 
234 
237 
239  OffsetType m_Offsets[8];
240 };
241 }
242 #ifndef OTB_MANUAL_INSTANTIATION
244 #endif
245 
246 #endif
otb::ImageToSURFKeyPointSetFilter::OutputPointSetPointerType
TOutputPointSet::Pointer OutputPointSetPointerType
Definition: otbImageToSURFKeyPointSetFilter.h:89
otbImageList.h
otb::ImageToSURFKeyPointSetFilter::VectorPointType
itk::Vector< PixelValue, 3 > VectorPointType
Definition: otbImageToSURFKeyPointSetFilter.h:125
otb::ImageToSURFKeyPointSetFilter::InputImageType
TInputImage InputImageType
Definition: otbImageToSURFKeyPointSetFilter.h:76
otb::ImageToSURFKeyPointSetFilter::PixelValue
InputImageType::PixelType PixelValue
Definition: otbImageToSURFKeyPointSetFilter.h:83
otb::ImageToSURFKeyPointSetFilter::NeighborhoodIteratorType
itk::ConstNeighborhoodIterator< InputImageType > NeighborhoodIteratorType
Definition: otbImageToSURFKeyPointSetFilter.h:105
otb::ImageToHessianDeterminantImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageToHessianDeterminantImageFilter.h:96
otb::ImageToSURFKeyPointSetFilter::InputImagePointerType
InputImageType::Pointer InputImagePointerType
Definition: otbImageToSURFKeyPointSetFilter.h:80
otb::ImageToSURFKeyPointSetFilter::Self
ImageToSURFKeyPointSetFilter Self
Definition: otbImageToSURFKeyPointSetFilter.h:67
otb::ImageToSURFKeyPointSetFilter::m_ImageMovedPrev
InputImagePointerType m_ImageMovedPrev
Definition: otbImageToSURFKeyPointSetFilter.h:223
otb::ImageToSURFKeyPointSetFilter::m_DetHessianFilter
DetHessianPointerFilter m_DetHessianFilter
Definition: otbImageToSURFKeyPointSetFilter.h:227
otb::ImageToSURFKeyPointSetFilter::OutputPointType
TOutputPointSet::PointType OutputPointType
Definition: otbImageToSURFKeyPointSetFilter.h:91
otb::ImageToSURFKeyPointSetFilter::OutputPointIdentifierType
TOutputPointSet::PointIdentifier OutputPointIdentifierType
Definition: otbImageToSURFKeyPointSetFilter.h:92
otb::ImageToSURFKeyPointSetFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageToSURFKeyPointSetFilter.h:69
otb::ImageToSURFKeyPointSetFilter::m_NumberOfPoints
int m_NumberOfPoints
Definition: otbImageToSURFKeyPointSetFilter.h:215
otb::ImageToPointSetFilter
Base class to output PointSet data with image data as input.
Definition: otbImageToPointSetFilter.h:44
otb::ImageToSURFKeyPointSetFilter::m_DoHThreshold
double m_DoHThreshold
Definition: otbImageToSURFKeyPointSetFilter.h:218
otb::ImageToSURFKeyPointSetFilter::m_ImageList
ImageListTypePointer m_ImageList
Definition: otbImageToSURFKeyPointSetFilter.h:233
otbImageToHessianDeterminantImageFilter.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ImageToSURFKeyPointSetFilter::ResampleFilterType
itk::ResampleImageFilter< InputImageType, InputImageType > ResampleFilterType
Definition: otbImageToSURFKeyPointSetFilter.h:116
otb::ImageToSURFKeyPointSetFilter::ImageListTypePointer
ImageListType::Pointer ImageListTypePointer
Definition: otbImageToSURFKeyPointSetFilter.h:121
otb::ImageToSURFKeyPointSetFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbImageToSURFKeyPointSetFilter.h:70
otb::ImageToSURFKeyPointSetFilter::m_OctavesNumber
int m_OctavesNumber
Definition: otbImageToSURFKeyPointSetFilter.h:209
otb::ImageToSURFKeyPointSetFilter::Superclass
ImageToPointSetFilter< TInputImage, TOutputPointSet > Superclass
Definition: otbImageToSURFKeyPointSetFilter.h:68
otb::ImageToSURFKeyPointSetFilter::m_ScalesNumber
int m_ScalesNumber
Definition: otbImageToSURFKeyPointSetFilter.h:212
otb::ImageToSURFKeyPointSetFilter::IndexType
InputImageType::IndexType IndexType
Definition: otbImageToSURFKeyPointSetFilter.h:82
otb::ImageToSURFKeyPointSetFilter::ResampleFilterPointerType
ResampleFilterType::Pointer ResampleFilterPointerType
Definition: otbImageToSURFKeyPointSetFilter.h:117
otb::ImageToSURFKeyPointSetFilter::DetHessianPointerFilter
ImageToDetHessianImageType::Pointer DetHessianPointerFilter
Definition: otbImageToSURFKeyPointSetFilter.h:113
otb::ImageList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageList.h:45
otb::ImageToSURFKeyPointSetFilter::PixelIndex
InputImageType::IndexType PixelIndex
Definition: otbImageToSURFKeyPointSetFilter.h:81
otbImageToPointSetFilter.h
otb::ImageToSURFKeyPointSetFilter::OutputPointSetType
TOutputPointSet OutputPointSetType
Definition: otbImageToSURFKeyPointSetFilter.h:88
otb::ImageToSURFKeyPointSetFilter::OffsetType
NeighborhoodType::OffsetType OffsetType
Definition: otbImageToSURFKeyPointSetFilter.h:110
otb::ImageToSURFKeyPointSetFilter::m_determinantImage
InputImagePointerType m_determinantImage
Definition: otbImageToSURFKeyPointSetFilter.h:221
otb::ImageToSURFKeyPointSetFilter::ImageToDetHessianImageType
otb::ImageToHessianDeterminantImageFilter< InputImageType, InputImageType > ImageToDetHessianImageType
Definition: otbImageToSURFKeyPointSetFilter.h:112
otb::ImageList
This class represent a list of images.
Definition: otbImageList.h:39
otb::ImageToSURFKeyPointSetFilter::m_ImageMovedNext
InputImagePointerType m_ImageMovedNext
Definition: otbImageToSURFKeyPointSetFilter.h:224
otb::ImageToSURFKeyPointSetFilter
This class extracts key points from an image through a pyramidal gaussian based decomposition.
Definition: otbImageToSURFKeyPointSetFilter.h:62
otb::ImageToSURFKeyPointSetFilter::SpacingType
InputImageType::SpacingType SpacingType
Definition: otbImageToSURFKeyPointSetFilter.h:84
otb::ImageToSURFKeyPointSetFilter::m_DifferentSamplePoints
unsigned int m_DifferentSamplePoints
Definition: otbImageToSURFKeyPointSetFilter.h:236
otb::ImageToSURFKeyPointSetFilter::PointImageType
InputImageType::PointType PointImageType
Definition: otbImageToSURFKeyPointSetFilter.h:86
otb::ImageToSURFKeyPointSetFilter::VectorType
std::vector< double > VectorType
Definition: otbImageToSURFKeyPointSetFilter.h:124
otb::ImageToSURFKeyPointSetFilter::SizeType
InputImageType::SizeType SizeType
Definition: otbImageToSURFKeyPointSetFilter.h:85
otb::ImageToSURFKeyPointSetFilter::m_ImageCurrent
InputImagePointerType m_ImageCurrent
Definition: otbImageToSURFKeyPointSetFilter.h:222
otbImageToSURFKeyPointSetFilter.hxx
otb::ImageToSURFKeyPointSetFilter::NeighborhoodType
NeighborhoodIteratorType::NeighborhoodType NeighborhoodType
Definition: otbImageToSURFKeyPointSetFilter.h:109
otb::ImageToSURFKeyPointSetFilter::ImageListType
otb::ImageList< InputImageType > ImageListType
Definition: otbImageToSURFKeyPointSetFilter.h:120
otb::ImageToSURFKeyPointSetFilter::m_ResampleFilter
ResampleFilterPointerType m_ResampleFilter
Definition: otbImageToSURFKeyPointSetFilter.h:230
otb::ImageToSURFKeyPointSetFilter::OutputPixelType
TOutputPointSet::PixelType OutputPixelType
Definition: otbImageToSURFKeyPointSetFilter.h:90
otb::ImageToHessianDeterminantImageFilter
This class compute the Hessian determinant of each pixel of an input image.
Definition: otbImageToHessianDeterminantImageFilter.h:89