OTB  6.7.0
Orfeo Toolbox
otbStereoSensorModelToElevationMapFilter.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 otbStereoSensorModelToElevationMapFilter_h
22 #define otbStereoSensorModelToElevationMapFilter_h
23 
24 #include "itkImageToImageFilter.h"
26 #include "otbGenericRSTransform.h"
28 
29 namespace otb
30 {
82 template <class TInputImage, class TOutputHeight>
84  : public itk::ImageToImageFilter<TInputImage, TOutputHeight>
85 {
86 public:
87 
93 
95  itkNewMacro(Self);
96 
98  itkTypeMacro(StereoSensorModelToElevationFilter, ImageToImageFilter);
99 
101  typedef TInputImage InputImageType;
102  typedef typename InputImageType::PixelType InputPixelType;
103  typedef TOutputHeight OutputImageType;
104  typedef typename OutputImageType::RegionType OutputRegionType;
105  typedef typename OutputImageType::PixelType HeightType;
107 
113  <TInputImage, TInputImage> CorrelationMetricType;
115 
117  void SetMasterInput(const TInputImage * image);
118 
120  void SetSlaveInput(const TInputImage * image);
121 
123  const TInputImage * GetMasterInput() const;
124 
126  const TInputImage * GetSlaveInput() const;
127 
129  TOutputHeight * GetCorrelationOutput();
130 
134  itkSetMacro(LowerElevation, double);
135 
139  itkSetMacro(HigherElevation, double);
140 
142  itkSetMacro(ElevationStep, double);
143 
147  itkSetMacro(CorrelationThreshold, double);
148 
152  itkGetMacro(CorrelationThreshold, double);
153 
157  itkSetMacro(VarianceThreshold, double);
158 
162  itkGetMacro(VarianceThreshold, double);
163 
168  itkSetMacro(SubtractInitialElevation, bool);
169 
174  itkGetMacro(SubtractInitialElevation, bool);
175 
180  itkBooleanMacro(SubtractInitialElevation);
181 
183  void SetRadius(unsigned int radius)
184  {
185  m_Radius.Fill(radius);
186  this->Modified();
187  }
189 
190 protected:
193 
196 
198  void ThreadedGenerateData(const OutputRegionType& outputRegionForThread,
199  itk::ThreadIdType threadId) override;
200 
202  void GenerateInputRequestedRegion(void) override;
203 
205  void BeforeThreadedGenerateData() override;
206 
212  void VerifyInputInformation() override {}
213 
214 
215 private:
216  StereoSensorModelToElevationFilter(const Self&) = delete;
217  void operator=(const Self&) = delete;
218 
219  inline double Correlation(const std::vector<double>& master,
220  const std::vector<double>& slave) const;
221 
224 
227 
230 
233 
236 
239 
243 
248 
251 
252 };
253 } // End namespace otb
254 
255 #ifndef OTB_MANUAL_INSTANTIATION
257 #endif
258 
259 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
itk::InterpolateImageFunction< TInputImage, double > InterpolatorType
itk::ImageToImageFilter< TInputImage, TOutputHeight > Superclass
itk::NormalizedCorrelationImageToImageMetric< TInputImage, TInputImage > CorrelationMetricType
unsigned int ThreadIdType
This is the class to handle generic remote sensing transform.
Using sensor models to perform correlation along epipolars.
VectorImageType::PointType PointType
Definition: mvdTypes.h:189