OTB  6.7.0
Orfeo Toolbox
otbGCPsToRPCSensorModelImageFilter.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 otbGCPsToRPCSensorModelImageFilter_h
22 #define otbGCPsToRPCSensorModelImageFilter_h
23 
25 #include "itkCastImageFilter.h"
26 #include "otbDEMHandler.h"
27 
28 #include "otbImageKeywordlist.h"
29 
30 namespace otb {
31 
78 template <class TImage>
80  public itk::CastImageFilter<TImage, TImage>
81 {
82 public:
88 
92  typedef std::pair<Point2DType, Point3DType> GCPType;
93  typedef std::vector<GCPType> GCPsContainerType;
94  typedef std::vector<double> ErrorsContainerType;
95 
98 
102 
104  itkNewMacro(Self);
105 
107  itkTypeMacro(GCPsToRPCSensorModelImageFilter, CastImageFilter);
108 
110  itkStaticConstMacro(ImageDimension, unsigned int,
111  TImage::ImageDimension);
112 
114 // itkSetMacro(UseImageGCPs, bool);
115 // itkGetMacro(UseImageGCPs, bool);
116 // itkBooleanMacro(UseImageGCPs);
117  void SetUseImageGCPs(bool use);
118  void LoadImageGCPs();
120 
122  itkSetMacro(UseDEM, bool);
123  itkGetMacro(UseDEM, bool);
124  itkBooleanMacro(UseDEM);
126 
128  itkSetMacro(MeanElevation, double);
129  itkGetConstReferenceMacro(MeanElevation, double);
131 
133  itkSetObjectMacro(DEMHandler, DEMHandlerType);
134  itkGetObjectMacro(DEMHandler, DEMHandlerType);
136 
138  itkGetConstReferenceMacro(RMSGroundError, double);
139 
141  ErrorsContainerType& GetErrorsContainer();
142 
144  itkGetConstReferenceMacro(MeanError, double);
145 
148  GCPsContainerType& GetGCPsContainer();
149 
151  void SetGCPsContainer(const GCPsContainerType& container);
152 
154  itkGetConstReferenceMacro(Keywordlist, ImageKeywordlist);
155 
159  void AddGCP(const Point2DType& sensorPoint, const Point3DType& groundPoint);
160 
165  void AddGCP(const Point2DType& sensorPoint, const Point2DType& groundPoint);
166 
168  void RemoveGCP(unsigned int id);
169 
171  void ClearGCPs();
172 
173 protected:
176 
179 
181  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
182 
185  void GenerateOutputInformation() override;
186 
188  void Modified() const override;
189 
190 private:
191  GCPsToRPCSensorModelImageFilter (const Self &) = delete;
192  void operator =(const Self&) = delete;
193 
195  void ComputeErrors();
196 
199 
202 
205 
207  double m_MeanError;
208 
210  bool m_UseDEM;
211 
215 
218 
221 
224 
226  mutable bool m_ModelUpToDate;
227 
228 }; // end of class
229 
230 } // end of namespace otb
231 
232 #ifndef OTB_MANUAL_INSTANTIATION
234 #endif
235 
236 #endif
itk::ContinuousIndex< double, 3 > Continuous3DIndexType
Storage and conversion for OSSIM metadata.
This filter estimates a RPC sensor models from GCPs.
std::pair< Point2DType, Point3DType > GCPType
itk::CastImageFilter< TImage, TImage > Superclass
Single access point for DEM data retrieval.
Definition: otbDEMHandler.h:90