OTB  9.0.0
Orfeo Toolbox
otbGCPsToRPCSensorModelImageFilter.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 otbGCPsToRPCSensorModelImageFilter_h
22 #define otbGCPsToRPCSensorModelImageFilter_h
23 
24 #include "itkUnaryFunctorImageFilter.h"
25 #include "itkCastImageFilter.h"
26 #include "otbDEMHandler.h"
27 
28 namespace otb
29 {
30 
77 template <class TImage>
78 class ITK_EXPORT GCPsToRPCSensorModelImageFilter : public itk::CastImageFilter<TImage, TImage>
79 {
80 public:
83  typedef itk::CastImageFilter<TImage, TImage> Superclass;
84  typedef itk::SmartPointer<Self> Pointer;
85  typedef itk::SmartPointer<const Self> ConstPointer;
86 
88  typedef itk::Point<double, 2> Point2DType;
89  typedef itk::Point<double, 3> Point3DType;
90  typedef std::pair<Point2DType, Point3DType> GCPType;
91  typedef std::vector<GCPType> GCPsContainerType;
92  typedef std::vector<double> ErrorsContainerType;
93 
94  typedef itk::ContinuousIndex<> ContinuousIndexType;
95  typedef itk::ContinuousIndex<double, 3> Continuous3DIndexType;
96 
99 
101  itkNewMacro(Self);
102 
104  itkTypeMacro(GCPsToRPCSensorModelImageFilter, CastImageFilter);
105 
107  itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension);
108 
110  // itkSetMacro(UseImageGCPs, bool);
111  // itkGetMacro(UseImageGCPs, bool);
112  // itkBooleanMacro(UseImageGCPs);
113  void SetUseImageGCPs(bool use);
114  void LoadImageGCPs();
116 
118  itkSetMacro(UseDEM, bool);
119  itkGetMacro(UseDEM, bool);
120  itkBooleanMacro(UseDEM);
122 
124  itkSetMacro(MeanElevation, double);
125  itkGetConstReferenceMacro(MeanElevation, double);
127 
129  itkGetConstReferenceMacro(RMSGroundError, double);
130 
132  ErrorsContainerType& GetErrorsContainer();
133 
135  itkGetConstReferenceMacro(MeanError, double);
136 
139  GCPsContainerType& GetGCPsContainer();
140 
142  void SetGCPsContainer(const GCPsContainerType& container);
143 
147  void AddGCP(const Point2DType& sensorPoint, const Point3DType& groundPoint);
148 
153  void AddGCP(const Point2DType& sensorPoint, const Point2DType& groundPoint);
154 
156  void RemoveGCP(unsigned int id);
157 
159  void ClearGCPs();
160 
161 protected:
164 
167 
169  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
170 
173  void GenerateOutputInformation() override;
174 
176  void Modified() const override;
177 
178 private:
179  GCPsToRPCSensorModelImageFilter(const Self&) = delete;
180  void operator=(const Self&) = delete;
181 
183  void ComputeErrors();
184 
187 
190 
193 
195  double m_MeanError;
196 
198  bool m_UseDEM;
199 
203 
206 
209 
211  mutable bool m_ModelUpToDate;
212 
213 }; // end of class
214 
215 } // end of namespace otb
216 
217 #ifndef OTB_MANUAL_INSTANTIATION
219 #endif
220 
221 #endif
otb::GCPsToRPCSensorModelImageFilter::ErrorsContainerType
std::vector< double > ErrorsContainerType
Definition: otbGCPsToRPCSensorModelImageFilter.h:92
otb::GCPsToRPCSensorModelImageFilter::GCPsContainerType
std::vector< GCPType > GCPsContainerType
Definition: otbGCPsToRPCSensorModelImageFilter.h:91
otb::GCPsToRPCSensorModelImageFilter::m_UseDEM
bool m_UseDEM
Definition: otbGCPsToRPCSensorModelImageFilter.h:198
otb::GCPsToRPCSensorModelImageFilter::m_ModelUpToDate
bool m_ModelUpToDate
Definition: otbGCPsToRPCSensorModelImageFilter.h:211
otb::GCPsToRPCSensorModelImageFilter::Point2DType
itk::Point< double, 2 > Point2DType
Definition: otbGCPsToRPCSensorModelImageFilter.h:88
otb::GCPsToRPCSensorModelImageFilter::m_ImageMetadata
ImageMetadata m_ImageMetadata
Definition: otbGCPsToRPCSensorModelImageFilter.h:208
otbDEMHandler.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::GCPsToRPCSensorModelImageFilter::DEMHandlerType
otb::DEMHandler DEMHandlerType
Definition: otbGCPsToRPCSensorModelImageFilter.h:98
otb::DEMHandler
Single access point for DEM data retrieval.
Definition: otbDEMHandler.h:113
otb::GCPsToRPCSensorModelImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbGCPsToRPCSensorModelImageFilter.h:85
otb::GCPsToRPCSensorModelImageFilter::m_GCPsContainer
GCPsContainerType m_GCPsContainer
Definition: otbGCPsToRPCSensorModelImageFilter.h:205
otb::GCPsToRPCSensorModelImageFilter::m_RMSGroundError
double m_RMSGroundError
Definition: otbGCPsToRPCSensorModelImageFilter.h:189
otb::GCPsToRPCSensorModelImageFilter::Continuous3DIndexType
itk::ContinuousIndex< double, 3 > Continuous3DIndexType
Definition: otbGCPsToRPCSensorModelImageFilter.h:95
otb::GCPsToRPCSensorModelImageFilter::m_UseImageGCPs
bool m_UseImageGCPs
Definition: otbGCPsToRPCSensorModelImageFilter.h:186
otb::GCPsToRPCSensorModelImageFilter::m_ErrorsContainer
ErrorsContainerType m_ErrorsContainer
Definition: otbGCPsToRPCSensorModelImageFilter.h:192
otb::GCPsToRPCSensorModelImageFilter::GCPType
std::pair< Point2DType, Point3DType > GCPType
Definition: otbGCPsToRPCSensorModelImageFilter.h:90
otb::GCPsToRPCSensorModelImageFilter::ContinuousIndexType
itk::ContinuousIndex ContinuousIndexType
Definition: otbGCPsToRPCSensorModelImageFilter.h:94
otb::ImageMetadata
Generic class containing image metadata used in OTB.
Definition: otbImageMetadata.h:270
otbGCPsToRPCSensorModelImageFilter.hxx
otb::GCPsToRPCSensorModelImageFilter::Point3DType
itk::Point< double, 3 > Point3DType
Definition: otbGCPsToRPCSensorModelImageFilter.h:89
otb::GCPsToRPCSensorModelImageFilter::Self
GCPsToRPCSensorModelImageFilter Self
Definition: otbGCPsToRPCSensorModelImageFilter.h:82
otb::GCPsToRPCSensorModelImageFilter::Superclass
itk::CastImageFilter< TImage, TImage > Superclass
Definition: otbGCPsToRPCSensorModelImageFilter.h:83
otb::GCPsToRPCSensorModelImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGCPsToRPCSensorModelImageFilter.h:84
otb::GCPsToRPCSensorModelImageFilter
This filter estimates a RPC sensor models from GCPs.
Definition: otbGCPsToRPCSensorModelImageFilter.h:78
otb::GCPsToRPCSensorModelImageFilter::m_MeanError
double m_MeanError
Definition: otbGCPsToRPCSensorModelImageFilter.h:195
otb::GCPsToRPCSensorModelImageFilter::m_MeanElevation
double m_MeanElevation
Definition: otbGCPsToRPCSensorModelImageFilter.h:202