21 #ifndef otbImageToSIFTKeyPointSetFilter_h
22 #define otbImageToSIFTKeyPointSetFilter_h
26 #include "itkExpandImageFilter.h"
27 #include "itkDiscreteGaussianImageFilter.h"
28 #include "itkRecursiveGaussianImageFilter.h"
29 #include "itkSubtractImageFilter.h"
30 #include "itkShrinkImageFilter.h"
31 #include "itkConstNeighborhoodIterator.h"
32 #include "itkImageRegionConstIterator.h"
33 #include "itkVector.h"
34 #include "itkMinimumMaximumImageCalculator.h"
35 #include "itkUnaryFunctorImageFilter.h"
36 #include "itkGradientImageFilter.h"
52 template <
class TInputPixel,
class TOutputPixel>
58 return std::sqrt(input[0] * input[0] + input[1] * input[1]);
68 template <
class TInputPixel,
class TOutputPixel>
74 TOutputPixel resp = std::atan2(input[1], input[0]);
115 template <
class TInputImage,
class TOutputPo
intSet>
145 itkSetMacro(OctavesNumber,
unsigned int);
146 itkGetMacro(OctavesNumber,
unsigned int);
150 itkSetMacro(ScalesNumber,
unsigned int);
151 itkGetMacro(ScalesNumber,
unsigned int);
155 itkSetMacro(ExpandFactors,
unsigned int);
156 itkGetMacro(ExpandFactors,
unsigned int);
160 itkSetMacro(ShrinkFactors,
unsigned int);
161 itkGetMacro(ShrinkFactors,
unsigned int);
165 itkSetMacro(Sigma0,
double);
166 itkGetMacro(Sigma0,
double);
172 itkSetMacro(DoGThreshold,
double);
173 itkGetMacro(DoGThreshold,
double);
179 itkSetMacro(EdgeThreshold,
double);
180 itkGetMacro(EdgeThreshold,
double);
184 itkSetMacro(SigmaFactorOrientation,
double);
185 itkGetMacro(SigmaFactorOrientation,
double);
189 itkSetMacro(SigmaFactorDescriptor,
double);
190 itkGetMacro(SigmaFactorDescriptor,
double);
234 void GenerateData()
override;
245 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
248 void InitializeInputImage();
254 void ComputeDifferenceOfGaussian(InputImagePointerType input);
257 void DetectKeyPoint(
const unsigned int octave);
267 bool IsLocalExtremum(
const NeighborhoodIteratorType& currentScale,
const NeighborhoodIteratorType& previousScale,
268 const NeighborhoodIteratorType& nextScale)
const;
283 bool RefineLocationKeyPoint(
const NeighborhoodIteratorType& currentScale,
const NeighborhoodIteratorType& previousScale,
284 const NeighborhoodIteratorType& nextScale, VectorPointType& solution);
294 std::vector<PixelType> ComputeKeyPointOrientations(
const NeighborhoodIteratorType& currentScale,
const unsigned int scale,
const PixelType translation);
304 std::vector<PixelType> ComputeKeyPointDescriptor(
const NeighborhoodIteratorType& currentScale,
const unsigned int scale,
const PixelType& orientation);
335 typename GaussianFilterType::ScalarRealType
m_Sigma0;
399 #ifndef OTB_MANUAL_INSTANTIATION
This functor computes the magnitude of a covariant vector.
TOutputPixel operator()(const TInputPixel &input)
This functor computes the orientation of a cavariant vector Orientation values lies between 0 and 2*...
TOutputPixel operator()(const TInputPixel &input)
This class represent a list of images.
itk::SmartPointer< Self > Pointer
Base class to output PointSet data with image data as input.
TInputImage InputImageType
This class extracts key points from an input image, trough a pyramidal decomposition.
TInputImage InputImageType
GradientFilterPointerType m_GradientFilter
ShrinkFilterPointerType m_ShrinkFilter
TInputImage::PixelType PixelType
~ImageToSIFTKeyPointSetFilter() override
GaussianFilterType::Pointer GaussianFilterPointerType
TInputImage::Pointer InputImagePointerType
GradientFilterType::OutputImageType GradientOutputImageType
SubtractFilterPointerType m_SubtractFilter
unsigned int m_ShrinkFactors
GaussianFilterPointerType m_XGaussianFilter
InputImagePointerType m_LastGaussian
itk::GradientImageFilter< InputImageType, PixelType, PixelType > GradientFilterType
otb::ImageList< InputImageType > ImageListType
OrientationFilterType::Pointer OrientationFilterPointerType
itk::SmartPointer< Self > Pointer
GaussianFilterPointerType m_YGaussianFilter
itk::UnaryFunctorImageFilter< GradientOutputImageType, InputImageType, Functor::MagnitudeFunctor< typename GradientOutputImageType::PixelType, typename InputImageType::PixelType > > MagnitudeFilterType
std::vector< double > m_HistogramGaussianWeights
ImageListPointerType m_DoGList
GradientFilterType::Pointer GradientFilterPointerType
TOutputPointSet::Pointer OutputPointSetPointerType
itk::ShrinkImageFilter< InputImageType, InputImageType > ShrinkFilterType
MagnitudeFilterPointerType m_MagnitudeFilter
MagnitudeFilterType::Pointer MagnitudeFilterPointerType
void operator=(const Self &)=delete
MinimumMaximumCalculatorType::Pointer MinimumMaximumCalculatorPointerType
double m_SigmaFactorOrientation
itk::Vector< PixelType, 3 > VectorPointType
itk::UnaryFunctorImageFilter< GradientOutputImageType, InputImageType, Functor::OrientationFunctor< typename GradientOutputImageType::PixelType, typename InputImageType::PixelType > > OrientationFilterType
unsigned int m_ScalesNumber
NeighborhoodType::OffsetType OffsetType
unsigned int m_ExpandFactors
itk::MinimumMaximumImageCalculator< InputImageType > MinimumMaximumCalculatorType
ExpandFilterType::Pointer ExpandFilterPointerType
OrientationFilterPointerType m_OrientationFilter
unsigned int m_DiscardedKeyPoints
GaussianFilterType::ScalarRealType m_Sigma0
unsigned int m_ChangeSamplePointsMax
itk::SubtractImageFilter< InputImageType, InputImageType, InputImageType > SubtractFilterType
ExpandFilterPointerType m_ExpandFilter
itk::ImageRegionConstIterator< InputImageType > RegionIteratorType
itk::ConstNeighborhoodIterator< InputImageType > NeighborhoodIteratorType
double m_SigmaFactorDescriptor
TOutputPointSet::PointIdentifier OutputPointIdentifierType
itk::ExpandImageFilter< TInputImage, TInputImage > ExpandFilterType
double m_RatioEdgeThreshold
unsigned int m_OctavesNumber
TOutputPointSet OutputPointSetType
NeighborhoodIteratorType::NeighborhoodType NeighborhoodType
TOutputPointSet::PixelType OutputPixelType
ImageToSIFTKeyPointSetFilter(const Self &)=delete
ImageListType::Pointer ImageListPointerType
SubtractFilterType::Pointer SubtractFilterPointerType
PixelType m_GradientMagnitudeThreshold
ImageListPointerType m_MagnitudeList
itk::SmartPointer< const Self > ConstPointer
ImageToSIFTKeyPointSetFilter Self
TOutputPointSet::PointType OutputPointType
ImageToPointSetFilter< TInputImage, TOutputPointSet > Superclass
unsigned int m_DifferentSamplePoints
ShrinkFilterType::Pointer ShrinkFilterPointerType
ImageListPointerType m_OrientationList
itk::RecursiveGaussianImageFilter< InputImageType, InputImageType > GaussianFilterType
OutputPointIdentifierType m_ValidatedKeyPoints
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
constexpr double CONST_2PI