OTB  9.0.0
Orfeo Toolbox
otbHorizontalSobelVectorImageFilter.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 otbHorizontalSobelVectorImageFilter_h
22 #define otbHorizontalSobelVectorImageFilter_h
23 
25 
26 namespace otb
27 {
28 
29 namespace Functor
30 {
36 template <class TInput, class TOutput>
38 {
39 public:
41  {
42  }
44  {
45  }
46 
47  TOutput operator()(const TInput& input)
48  {
49  unsigned int length = input.GetPixel(0).Size();
50  TOutput output(length);
51  for (unsigned int i = 0; i < length; ++i)
52  {
53  output[i] = static_cast<typename TOutput::ValueType>((input.GetPixel(0)[i] - input.GetPixel(2)[i]) + 2 * (input.GetPixel(3)[i] - input.GetPixel(5)[i]) +
54  (input.GetPixel(6)[i] - input.GetPixel(8)[i]));
55  }
56  return output;
57  }
58 }; // end of functor class
59 
60 } // end of namespace Functor
61 
67 template <class TInputImage, class TOutputImage>
70  TInputImage, TOutputImage, Functor::HorizontalSobelOperator<typename itk::ConstNeighborhoodIterator<TInputImage>, typename TOutputImage::PixelType>>
71 {
72 public:
76  TInputImage, TOutputImage, Functor::HorizontalSobelOperator<typename itk::ConstNeighborhoodIterator<TInputImage>, typename TOutputImage::PixelType>>
78  typedef itk::SmartPointer<Self> Pointer;
79  typedef itk::SmartPointer<const Self> ConstPointer;
80 
82  itkNewMacro(Self);
83 
85  itkTypeMacro(HorizontalSobelVectorImageFilter, ImageToImageFilter);
86 
87 protected:
89  {
90  typename Superclass::RadiusType radius = {{1, 1}};
91  this->SetRadius(radius);
92  }
94  {
95  }
96 
97 private:
98  HorizontalSobelVectorImageFilter(const Self&); // Not implemented
99  void operator=(const Self&); // Not implemented
100 }; // end of class
101 
102 } // end of namespace otb
103 
104 
105 #endif // otbHorizontalSobelVectorImageFilter_h
otb::UnaryFunctorNeighborhoodVectorImageFilter::RadiusType
NeighborhoodIteratorType::RadiusType RadiusType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:98
otb::HorizontalSobelVectorImageFilter::~HorizontalSobelVectorImageFilter
~HorizontalSobelVectorImageFilter() override
Definition: otbHorizontalSobelVectorImageFilter.h:93
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::HorizontalSobelVectorImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbHorizontalSobelVectorImageFilter.h:79
otb::Functor::HorizontalSobelOperator
Performs the calculation of horizontal Sobel derivation.
Definition: otbHorizontalSobelVectorImageFilter.h:37
otb::HorizontalSobelVectorImageFilter::Self
HorizontalSobelVectorImageFilter Self
Definition: otbHorizontalSobelVectorImageFilter.h:74
otb::HorizontalSobelVectorImageFilter
Implements the Horizontal Sobel Gradient to be processed on a vector image.
Definition: otbHorizontalSobelVectorImageFilter.h:68
otb::HorizontalSobelVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbHorizontalSobelVectorImageFilter.h:78
otb::UnaryFunctorNeighborhoodVectorImageFilter
Implements neighborhood-wise generic operation of one vector image.
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:42
otb::Functor::HorizontalSobelOperator::HorizontalSobelOperator
HorizontalSobelOperator()
Definition: otbHorizontalSobelVectorImageFilter.h:40
otbUnaryFunctorNeighborhoodVectorImageFilter.h
otb::Functor::HorizontalSobelOperator::~HorizontalSobelOperator
virtual ~HorizontalSobelOperator()
Definition: otbHorizontalSobelVectorImageFilter.h:43
otb::Functor::HorizontalSobelOperator::operator()
TOutput operator()(const TInput &input)
Definition: otbHorizontalSobelVectorImageFilter.h:47
otb::HorizontalSobelVectorImageFilter::Superclass
UnaryFunctorNeighborhoodVectorImageFilter< TInputImage, TOutputImage, Functor::HorizontalSobelOperator< typename itk::ConstNeighborhoodIterator< TInputImage >, typename TOutputImage::PixelType > > Superclass
Definition: otbHorizontalSobelVectorImageFilter.h:77
otb::HorizontalSobelVectorImageFilter::HorizontalSobelVectorImageFilter
HorizontalSobelVectorImageFilter()
Definition: otbHorizontalSobelVectorImageFilter.h:88