OTB  6.7.0
Orfeo Toolbox
otbAdhesionCorrectionFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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 otbAdhesionCorrectionFilter_h
22 #define otbAdhesionCorrectionFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "otbImage.h"
29 #include <algorithm>
30 
31 namespace otb
32 {
33 
67 template <class TImage, class TMask>
68 class ITK_EXPORT AdhesionCorrectionFilter : public itk::ImageToImageFilter<TImage, TImage>
69 {
70 public:
76 
78  itkNewMacro(Self);
79 
81  itkTypeMacro(AdhesionCorrectionFilter, ImageToImageFilter);
82 
84  typedef typename TImage::RegionType ImageRegionType;
85  typedef typename TImage::PixelType PixelType;
86  typedef typename TImage::Pointer ImagePointerType;
87  typedef typename TImage::SizeType SizeType;
88  typedef typename TImage::IndexType IndexType;
89  typedef typename TImage::SpacingType SpacingType;
90  typedef typename TImage::PointType PointType;
91  typedef typename TImage::OffsetType OffsetType;
92  typedef typename TMask::Pointer MaskImagePointerType;
93  typedef typename TMask::PixelType MaskImagePixelType;
94 
96 
99 
100  typedef std::vector<int> IntVectorType;
101 
103  void SetMedianDisparityInput( const TImage * medianmap);
104  void SetMedianMaskInput( const TMask * medianmask);
105  void SetEdgesDisparityInput( const TImage * cannymedianmap);
106  void SetSubPixelMaskInput( const TMask * subpixelmask);
108 
110  const TImage * GetMedianDisparityInput();
111  const TMask * GetMedianMaskInput();
112  const TImage * GetEdgesDisparityInput();
113  const TMask * GetSubPixelMaskInput();
115 
117  TMask * GetOutputMask(); // mask corresponding to the corrected disparity map
118 
120  TImage * GetOutputRiskEdges();
121 
123  itkSetMacro(Radius, SizeType);
124  itkGetMacro(Radius, SizeType);
126 
128  void SetRadius(unsigned int radius)
129  {
130  m_Radius.Fill(radius);
131  }
132 
134  itkSetMacro(Tolerance, double);
135  itkGetMacro(Tolerance, double);
137 
139  itkSetMacro(DiscontinuityThreshold, double);
140  itkGetMacro(DiscontinuityThreshold, double);
142 
144  itkSetMacro(DiscontinuityHighThreshold, double);
145  itkGetMacro(DiscontinuityHighThreshold, double);
147 
149  itkSetMacro(MaxEdgeGap, double);
150  itkGetMacro(MaxEdgeGap, double);
152 
154  itkSetMacro(EdgeThreshold, double);
155  itkGetMacro(EdgeThreshold, double);
157 
158 protected:
161 
164 
166  void GenerateData() override;
167 
169  void GenerateInputRequestedRegion(void) override;
170 
172  void GenerateOutputInformation(void) override;
173 
174 private:
175  AdhesionCorrectionFilter(const Self&) = delete;
176  void operator=(const Self&) = delete;
177 
181 
183  double m_Tolerance;
184 
188  double m_MaxEdgeGap;
190 
191 };
192 
193 } // end namespace otb
194 
195 #ifndef OTB_MANUAL_INSTANTIATION
197 #endif
198 
199 #endif
200 
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
itk::SmartPointer< const Self > ConstPointer
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
itk::ConstNeighborhoodIterator< TImage > NeighborhoodIteratorType
This filter eliminates pixels risking adhesion from the input disparity map. To do so it applies the ...
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:181
VectorImageType::PointType PointType
Definition: mvdTypes.h:189
itk::ImageToImageFilter< TImage, TImage > Superclass