OTB  6.7.0
Orfeo Toolbox
otbStereorectificationDisplacementFieldSource.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 otbStereorectificationDisplacementFieldSource_h
22 #define otbStereorectificationDisplacementFieldSource_h
23 
24 #include "itkImageSource.h"
25 #include "otbGenericRSTransform.h"
27 #include "itkVector.h"
28 #include "otbMacro.h"
29 
30 namespace otb
31 {
89 template <class TInputImage, class TOutputImage >
91  : public itk::ImageSource<TOutputImage>
92 {
93 public:
99 
100  // Inputs and outputs relative typedefs
101  typedef TInputImage InputImageType;
102  typedef typename InputImageType::Pointer InputImagePointerType;
103  typedef TOutputImage OutputImageType;
104  typedef typename OutputImageType::Pointer OutputImagePointerType;
105 
106  // Image related typedefs
110  typedef typename OutputImageType::RegionType RegionType;
111 
112  // 3D RS transform
113  // TODO: Allow tuning precision (i.e. double or float)
116 
117  // 3D points
119 
121  itkNewMacro( Self );
122 
124  itkTypeMacro( StereorectificationDisplacementFieldSource, ImageSource );
125 
127  itkSetMacro(Scale,double);
128  itkGetConstReferenceMacro(Scale,double);
130 
132  itkSetMacro(GridStep,double);
133  itkGetMacro(GridStep,double);
135 
137  itkSetObjectMacro(LeftImage,InputImageType);
138  itkGetObjectMacro(LeftImage,InputImageType);
140 
142  itkSetObjectMacro(RightImage,InputImageType);
143  itkGetObjectMacro(RightImage,InputImageType);
145 
147  itkGetConstReferenceMacro(RectifiedImageSize,SizeType);
148 
150  itkGetConstReferenceMacro(MeanBaselineRatio,double);
151 
153  const OutputImageType * GetLeftDisplacementFieldOutput() const;
154 
156  OutputImageType * GetLeftDisplacementFieldOutput();
157 
159  const OutputImageType * GetRightDisplacementFieldOutput() const;
160 
162  OutputImageType * GetRightDisplacementFieldOutput();
163 
164  itkSetMacro(UseDEM,bool);
165  itkGetMacro(UseDEM,bool);
166  itkBooleanMacro(UseDEM);
167 
168 protected:
171 
174 
176  void GenerateOutputInformation() override;
177 
179  void EnlargeOutputRequestedRegion(itk::DataObject * itkNotUsed(output)) override;
180 
182  void GenerateData() override;
183 
185  void PrintSelf( std::ostream& os, itk::Indent indent ) const override;
186 
187 private:
188  StereorectificationDisplacementFieldSource( const Self& ); // purposely
189  // not
190  // implemented
191  void operator=( const Self& ) = delete;
192 
195 
198  double m_Scale;
199 
203  double m_GridStep;
204 
207 
210 
213 
216 
219 
222 
226 
230  bool m_UseDEM;
231 };
233 
234 } // End namespace otb
235 
236 #ifndef OTB_MANUAL_INSTANTIATION
238 #endif
239 
240 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
Compute the deformation fields for stereo-rectification.
This is the class to handle generic remote sensing transform.
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:181
TOutputImage OutputImageType
VectorImageType::PointType PointType
Definition: mvdTypes.h:189