OTB  9.0.0
Orfeo Toolbox
otbBijectionCoherencyFilter.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 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 : public itk::ImageToImageFilter<TDisparityImage, TOutputImage>
50 {
51 public:
54  typedef itk::ImageToImageFilter<TDisparityImage, TOutputImage> Superclass;
55  typedef itk::SmartPointer<Self> Pointer;
56  typedef itk::SmartPointer<const Self> ConstPointer;
57 
59  itkNewMacro(Self);
60 
62  itkTypeMacro(BijectionCoherencyFilter, ImageToImageFilter);
63 
65  typedef TDisparityImage DispMapType;
66  typedef TOutputImage MaskType;
67 
68  typedef typename MaskType::RegionType OutputRegionType;
69  typedef typename DispMapType::RegionType InputRegionType;
70  typedef typename DispMapType::SizeType SizeType;
71  typedef typename DispMapType::IndexType IndexType;
72 
74  void SetDirectHorizontalDisparityMapInput(const TDisparityImage* hmap);
75 
77  void SetDirectVerticalDisparityMapInput(const TDisparityImage* vmap);
78 
80  void SetReverseHorizontalDisparityMapInput(const TDisparityImage* hmap);
81 
83  void SetReverseVerticalDisparityMapInput(const TDisparityImage* vmap);
84 
86  const TDisparityImage* GetDirectHorizontalDisparityMapInput() const;
87  const TDisparityImage* GetDirectVerticalDisparityMapInput() const;
88  const TDisparityImage* GetReverseHorizontalDisparityMapInput() const;
89  const TDisparityImage* GetReverseVerticalDisparityMapInput() const;
91 
93  itkSetMacro(Tolerance, double);
94 
96  itkGetMacro(Tolerance, double);
97 
99  itkSetMacro(MinHDisp, int);
100  itkGetMacro(MinHDisp, int);
102 
103  itkSetMacro(MaxHDisp, int);
104  itkGetMacro(MaxHDisp, int);
105 
106  itkSetMacro(MinVDisp, int);
107  itkGetMacro(MinVDisp, int);
108 
109  itkSetMacro(MaxVDisp, int);
110  itkGetMacro(MaxVDisp, int);
111 
112 protected:
115 
118 
120  void GenerateOutputInformation() override;
121 
123  void GenerateInputRequestedRegion() override;
124 
126  void ThreadedGenerateData(const OutputRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
127 
128 private:
129  BijectionCoherencyFilter(const Self&) = delete;
130  void operator=(const Self&) = delete;
131 
133  double m_Tolerance;
134 
137 
140 
143 
146 };
147 
148 } // end namespace otb
149 
150 #ifndef OTB_MANUAL_INSTANTIATION
152 #endif
153 
154 #endif
otb::BijectionCoherencyFilter::m_MaxHDisp
int m_MaxHDisp
Definition: otbBijectionCoherencyFilter.h:139
otb::BijectionCoherencyFilter::m_MinVDisp
int m_MinVDisp
Definition: otbBijectionCoherencyFilter.h:142
otb::BijectionCoherencyFilter::SizeType
DispMapType::SizeType SizeType
Definition: otbBijectionCoherencyFilter.h:70
otb::BijectionCoherencyFilter::DispMapType
TDisparityImage DispMapType
Definition: otbBijectionCoherencyFilter.h:62
otbImage.h
otb::BijectionCoherencyFilter::m_Tolerance
double m_Tolerance
Definition: otbBijectionCoherencyFilter.h:133
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::BijectionCoherencyFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbBijectionCoherencyFilter.h:56
otb::BijectionCoherencyFilter::Superclass
itk::ImageToImageFilter< TDisparityImage, TOutputImage > Superclass
Definition: otbBijectionCoherencyFilter.h:54
otb::BijectionCoherencyFilter::OutputRegionType
MaskType::RegionType OutputRegionType
Definition: otbBijectionCoherencyFilter.h:68
otb::BijectionCoherencyFilter::~BijectionCoherencyFilter
~BijectionCoherencyFilter() override
Definition: otbBijectionCoherencyFilter.h:117
otb::BijectionCoherencyFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbBijectionCoherencyFilter.h:55
otb::BijectionCoherencyFilter
Left-right coherency filter for disparity maps.
Definition: otbBijectionCoherencyFilter.h:49
otbBijectionCoherencyFilter.hxx
otb::BijectionCoherencyFilter::m_MinHDisp
int m_MinHDisp
Definition: otbBijectionCoherencyFilter.h:136
otb::BijectionCoherencyFilter::InputRegionType
DispMapType::RegionType InputRegionType
Definition: otbBijectionCoherencyFilter.h:69
otbLineOfSightOptimizer.h
otb::BijectionCoherencyFilter::MaskType
TOutputImage MaskType
Definition: otbBijectionCoherencyFilter.h:66
otb::BijectionCoherencyFilter::IndexType
DispMapType::IndexType IndexType
Definition: otbBijectionCoherencyFilter.h:71
otb::BijectionCoherencyFilter::m_MaxVDisp
int m_MaxVDisp
Definition: otbBijectionCoherencyFilter.h:145
otb::BijectionCoherencyFilter::Self
BijectionCoherencyFilter Self
Definition: otbBijectionCoherencyFilter.h:53