OTB  10.0.0
Orfeo Toolbox
otbGCPsToRPCSensorModelImageFilter.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 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 
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:
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
Casts input pixels to output pixel type.
Single access point for DEM data retrieval.
This filter estimates a RPC sensor models from GCPs.
GCPsToRPCSensorModelImageFilter(const Self &)=delete
void operator=(const Self &)=delete
itk::ContinuousIndex< double, 3 > Continuous3DIndexType
itk::CastImageFilter< TImage, TImage > Superclass
std::pair< Point2DType, Point3DType > GCPType
Generic class containing image metadata used in OTB.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.