OTB  9.0.0
Orfeo Toolbox
otbHistogramOfOrientedGradientCovariantImageFunction.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 otbHistogramOfOrientedGradientCovariantImageFunction_h
22 #define otbHistogramOfOrientedGradientCovariantImageFunction_h
23 
24 #include "itkImageFunction.h"
25 #include "itkFixedArray.h"
26 
27 namespace otb
28 {
29 
70 template <class TInputImage, class TOutputPrecision = double, class TCoordRep = double>
72  : public itk::ImageFunction<TInputImage, std::vector<std::vector<TOutputPrecision>>, TCoordRep>
73 {
74 public:
77  typedef itk::ImageFunction<TInputImage, std::vector<std::vector<TOutputPrecision>>, TCoordRep> Superclass;
78  typedef itk::SmartPointer<Self> Pointer;
79  typedef itk::SmartPointer<const Self> ConstPointer;
80 
82  itkTypeMacro(HistogramOfOrientedGradientCovariantImageFunction, ImageFunction);
83 
85  itkNewMacro(Self);
86 
88  typedef TInputImage InputImageType;
89  typedef typename InputImageType::PixelType InputPixelType;
90  typedef typename Superclass::IndexType IndexType;
91  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
92  typedef typename Superclass::PointType PointType;
93 
94  typedef TOutputPrecision OutputPrecisionType;
95  typedef typename Superclass::OutputType OutputType;
96 
97  typedef TCoordRep CoordRepType;
98 
100  itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
101 
103  OutputType EvaluateAtIndex(const IndexType& index) const override;
104 
106  OutputType Evaluate(const PointType& point) const override
107  {
108  IndexType index;
109  this->ConvertPointToNearestIndex(point, index);
110  return this->EvaluateAtIndex(index);
111  }
113  {
114  IndexType index;
115  this->ConvertContinuousIndexToNearestIndex(cindex, index);
116  return this->EvaluateAtIndex(index);
117  }
119 
123  itkSetMacro(NeighborhoodRadius, unsigned int);
124  itkGetConstReferenceMacro(NeighborhoodRadius, unsigned int);
126 
129  itkSetMacro(NumberOfOrientationBins, unsigned int);
130  itkGetConstReferenceMacro(NumberOfOrientationBins, unsigned int);
132 
133 
134 protected:
137  {
138  }
139  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
140 
141 private:
143  void operator=(const Self&) = delete;
144 
145  // Radius over which the principal orientation will be computed
146  unsigned int m_NeighborhoodRadius;
147 
148  // Number of bins in the orientation
150 };
151 
152 } // namespace otb
153 
154 #ifndef OTB_MANUAL_INSTANTIATION
156 #endif
157 
158 #endif
otbHistogramOfOrientedGradientCovariantImageFunction.hxx
otb::HistogramOfOrientedGradientCovariantImageFunction::EvaluateAtContinuousIndex
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:112
otb::HistogramOfOrientedGradientCovariantImageFunction::Superclass
itk::ImageFunction< TInputImage, std::vector< std::vector< TOutputPrecision > >, TCoordRep > Superclass
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:77
otb::HistogramOfOrientedGradientCovariantImageFunction::OutputPrecisionType
TOutputPrecision OutputPrecisionType
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:94
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::HistogramOfOrientedGradientCovariantImageFunction::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:79
otb::HistogramOfOrientedGradientCovariantImageFunction::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:78
otb::HistogramOfOrientedGradientCovariantImageFunction::m_NeighborhoodRadius
unsigned int m_NeighborhoodRadius
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:146
otb::HistogramOfOrientedGradientCovariantImageFunction::OutputType
Superclass::OutputType OutputType
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:95
otb::HistogramOfOrientedGradientCovariantImageFunction::PointType
Superclass::PointType PointType
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:92
otb::HistogramOfOrientedGradientCovariantImageFunction::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:89
otb::HistogramOfOrientedGradientCovariantImageFunction::IndexType
Superclass::IndexType IndexType
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:90
otb::HistogramOfOrientedGradientCovariantImageFunction::InputImageType
TInputImage InputImageType
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:85
otb::HistogramOfOrientedGradientCovariantImageFunction
Calculate the centered HOG features.
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:71
otb::HistogramOfOrientedGradientCovariantImageFunction::~HistogramOfOrientedGradientCovariantImageFunction
~HistogramOfOrientedGradientCovariantImageFunction() override
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:136
otb::HistogramOfOrientedGradientCovariantImageFunction::CoordRepType
TCoordRep CoordRepType
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:97
otb::HistogramOfOrientedGradientCovariantImageFunction::ContinuousIndexType
Superclass::ContinuousIndexType ContinuousIndexType
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:91
otb::HistogramOfOrientedGradientCovariantImageFunction::Evaluate
OutputType Evaluate(const PointType &point) const override
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:106
otb::HistogramOfOrientedGradientCovariantImageFunction::m_NumberOfOrientationBins
unsigned int m_NumberOfOrientationBins
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:149
otb::HistogramOfOrientedGradientCovariantImageFunction::Self
HistogramOfOrientedGradientCovariantImageFunction Self
Definition: otbHistogramOfOrientedGradientCovariantImageFunction.h:76