OTB  9.0.0
Orfeo Toolbox
otbVerticalSobelVectorImageFilter.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 otbVerticalSobelVectorImageFilter_h
22 #define otbVerticalSobelVectorImageFilter_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(6)[i]) + 2 * (input.GetPixel(1)[i] - input.GetPixel(7)[i]) +
54  (input.GetPixel(2)[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::VerticalSobelOperator<typename itk::ConstNeighborhoodIterator<TInputImage>, typename TOutputImage::PixelType>>
71 {
72 public:
76  TInputImage, TOutputImage, Functor::VerticalSobelOperator<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(VerticalSobelVectorImageFilter, ImageToImageFilter);
86 
87 protected:
89  {
90  typename Superclass::RadiusType radius = {{1, 1}};
91  this->SetRadius(radius);
92  }
94  {
95  }
96 
97 private:
98  VerticalSobelVectorImageFilter(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 // otbVerticalSobelVectorImageFilter_h
otb::VerticalSobelVectorImageFilter::Superclass
UnaryFunctorNeighborhoodVectorImageFilter< TInputImage, TOutputImage, Functor::VerticalSobelOperator< typename itk::ConstNeighborhoodIterator< TInputImage >, typename TOutputImage::PixelType > > Superclass
Definition: otbVerticalSobelVectorImageFilter.h:77
otb::UnaryFunctorNeighborhoodVectorImageFilter::RadiusType
NeighborhoodIteratorType::RadiusType RadiusType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:98
otb::VerticalSobelVectorImageFilter::VerticalSobelVectorImageFilter
VerticalSobelVectorImageFilter()
Definition: otbVerticalSobelVectorImageFilter.h:88
otb::VerticalSobelVectorImageFilter::~VerticalSobelVectorImageFilter
~VerticalSobelVectorImageFilter() override
Definition: otbVerticalSobelVectorImageFilter.h:93
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::VerticalSobelVectorImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbVerticalSobelVectorImageFilter.h:79
otb::Functor::VerticalSobelOperator::~VerticalSobelOperator
virtual ~VerticalSobelOperator()
Definition: otbVerticalSobelVectorImageFilter.h:43
otb::Functor::VerticalSobelOperator::operator()
TOutput operator()(const TInput &input)
Definition: otbVerticalSobelVectorImageFilter.h:47
otb::Functor::VerticalSobelOperator
Performs the calculation of vertical Sobel derivation.
Definition: otbVerticalSobelVectorImageFilter.h:37
otb::UnaryFunctorNeighborhoodVectorImageFilter
Implements neighborhood-wise generic operation of one vector image.
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:42
otb::VerticalSobelVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbVerticalSobelVectorImageFilter.h:78
otbUnaryFunctorNeighborhoodVectorImageFilter.h
otb::Functor::VerticalSobelOperator::VerticalSobelOperator
VerticalSobelOperator()
Definition: otbVerticalSobelVectorImageFilter.h:40
otb::VerticalSobelVectorImageFilter::Self
VerticalSobelVectorImageFilter Self
Definition: otbVerticalSobelVectorImageFilter.h:74
otb::VerticalSobelVectorImageFilter
Implements the Vertical Sobel Gradient to be processed on a vector image.
Definition: otbVerticalSobelVectorImageFilter.h:68