OTB  10.0.0
Orfeo Toolbox
otbDisparityTranslateFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 otbDisparityTranslateFilter_h
22 #define otbDisparityTranslateFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "otbVectorImage.h"
26 #include "otbImage.h"
27 
28 namespace otb
29 {
30 
46 template <class TDisparityImage, class TGridImage = otb::VectorImage<float, 2>, class TSensorImage = otb::Image<unsigned short, 2>,
47  class TMaskImage = otb::Image<unsigned char, 2>>
48 class ITK_EXPORT DisparityTranslateFilter : public itk::ImageToImageFilter<TDisparityImage, TDisparityImage>
49 {
50 public:
53  typedef itk::ImageToImageFilter<TDisparityImage, TDisparityImage> Superclass;
54  typedef itk::SmartPointer<Self> Pointer;
55  typedef itk::SmartPointer<const Self> ConstPointer;
56 
58  itkNewMacro(Self);
59 
61  itkTypeMacro(DisparityTranslateFilter, ImageToImageFilter);
62 
64  typedef TDisparityImage DispMapType;
65  typedef TGridImage GridType;
66  typedef TMaskImage MaskType;
67  typedef TSensorImage SensorType;
68 
69  typedef typename DispMapType::PixelType PixelType;
70  typedef typename DispMapType::RegionType RegionType;
71  typedef typename DispMapType::SizeType SizeType;
72  typedef typename DispMapType::IndexType IndexType;
73  typedef typename DispMapType::SpacingType SpacingType;
74  typedef typename DispMapType::PointType PointType;
75  typedef typename DispMapType::IndexValueType IndexValueType;
76 
77  typedef typename GridType::RegionType GridRegionType;
78 
80  itkSetMacro(NoDataValue, PixelType);
81  itkGetConstReferenceMacro(NoDataValue, PixelType);
83 
85  void SetHorizontalDisparityMapInput(const TDisparityImage* hmap);
86 
88  void SetVerticalDisparityMapInput(const TDisparityImage* vmap);
89 
91  void SetInverseEpipolarLeftGrid(const TGridImage* lgrid);
92 
94  void SetDirectEpipolarRightGrid(const TGridImage* rgrid);
95 
97  void SetDisparityMaskInput(const TMaskImage* mask);
98 
102  void SetLeftSensorImageInput(const TSensorImage* left);
103 
105  const TDisparityImage* GetHorizontalDisparityMapInput() const;
106  const TDisparityImage* GetVerticalDisparityMapInput() const;
107  const TGridImage* GetInverseEpipolarLeftGrid() const;
108  const TGridImage* GetDirectEpipolarRightGrid() const;
109  const TMaskImage* GetDisparityMaskInput() const;
110  const TSensorImage* GetLeftSensorImageInput() const;
112 
114  TDisparityImage* GetHorizontalDisparityMapOutput();
115  TDisparityImage* GetVerticalDisparityMapOutput();
117 
118 protected:
121 
124 
126  void GenerateOutputInformation() override;
127 
129  void GenerateInputRequestedRegion() override;
130 
132  void DynamicThreadedGenerateData(const RegionType& outputRegionForThread) override;
133 
139  void VerifyInputInformation() const override
140  {
141  }
142 
143 
144 private:
145  DisparityTranslateFilter(const Self&) = delete;
146  void operator=(const Self&) = delete;
147 
149 };
150 
151 } // end namespace otb
152 
153 #ifndef OTB_MANUAL_INSTANTIATION
155 #endif
156 
157 #endif
Translate epipolar disparities into sensor disparities.
itk::SmartPointer< const Self > ConstPointer
DisparityTranslateFilter(const Self &)=delete
itk::ImageToImageFilter< TDisparityImage, TDisparityImage > Superclass
void operator=(const Self &)=delete
DispMapType::IndexValueType IndexValueType
OTBMetadata_EXPORT char const * NoDataValue
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.