OTB  6.7.0
Orfeo Toolbox
otbBijectionCoherencyFilter.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 otbBijectionCoherencyFilter_h
22 #define otbBijectionCoherencyFilter_h
23 
24 #include "itkImageToImageFilter.h"
26 #include "otbImage.h"
27 
28 namespace otb
29 {
30 
48 template <class TDisparityImage, class TOutputImage = otb::Image<unsigned char> >
49 class ITK_EXPORT BijectionCoherencyFilter :
50  public itk::ImageToImageFilter<TDisparityImage,TOutputImage>
51 {
52 public:
55  typedef itk::ImageToImageFilter<TDisparityImage,
56  TOutputImage> Superclass;
59 
61  itkNewMacro(Self);
62 
64  itkTypeMacro(BijectionCoherencyFilter, ImageToImageFilter);
65 
67  typedef TDisparityImage DispMapType;
68  typedef TOutputImage MaskType;
69 
70  typedef typename MaskType::RegionType OutputRegionType;
71  typedef typename DispMapType::RegionType InputRegionType;
72  typedef typename DispMapType::SizeType SizeType;
74 
76  void SetDirectHorizontalDisparityMapInput( const TDisparityImage * hmap );
77 
79  void SetDirectVerticalDisparityMapInput( const TDisparityImage * vmap );
80 
82  void SetReverseHorizontalDisparityMapInput( const TDisparityImage * hmap );
83 
85  void SetReverseVerticalDisparityMapInput( const TDisparityImage * vmap );
86 
88  const TDisparityImage * GetDirectHorizontalDisparityMapInput() const;
89  const TDisparityImage * GetDirectVerticalDisparityMapInput() const;
90  const TDisparityImage * GetReverseHorizontalDisparityMapInput() const;
91  const TDisparityImage * GetReverseVerticalDisparityMapInput() const;
93 
95  itkSetMacro(Tolerance,double);
96 
98  itkGetMacro(Tolerance,double);
99 
101  itkSetMacro(MinHDisp,int);
102  itkGetMacro(MinHDisp,int);
104 
105  itkSetMacro(MaxHDisp,int);
106  itkGetMacro(MaxHDisp,int);
107 
108  itkSetMacro(MinVDisp,int);
109  itkGetMacro(MinVDisp,int);
110 
111  itkSetMacro(MaxVDisp,int);
112  itkGetMacro(MaxVDisp,int);
113 
114 protected:
117 
120 
122  void GenerateOutputInformation() override;
123 
125  void GenerateInputRequestedRegion() override;
126 
128  void ThreadedGenerateData(const OutputRegionType & outputRegionForThread, itk::ThreadIdType threadId) override;
129 
130 private:
131  BijectionCoherencyFilter(const Self&) = delete;
132  void operator=(const Self&) = delete;
133 
135  double m_Tolerance;
136 
139 
142 
145 
148 };
149 
150 } // end namespace otb
151 
152 #ifndef OTB_MANUAL_INSTANTIATION
154 #endif
155 
156 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
unsigned int ThreadIdType
itk::SmartPointer< const Self > ConstPointer
Left-right coherency filter for disparity maps.
itk::ImageToImageFilter< TDisparityImage, TOutputImage > Superclass