OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimRpcSolver.h
Go to the documentation of this file.
1 //**************************************************************************************************
2 //
3 // OSSIM Open Source Geospatial Data Processing Library
4 // See top level LICENSE.txt file for license information
5 //
6 //**************************************************************************************************
7 #ifndef ossimRpcSolver_HEADER
8 #define ossimRpcSolver_HEADER
9 
10 #include <vector>
12 #include <ossim/base/ossimRefPtr.h>
13 #include <ossim/base/ossimDpt.h>
14 #include <ossim/base/ossimGpt.h>
15 #include <ossim/base/ossimDrect.h>
17 #include <ossim/matrix/newmat.h>
22 
73 {
74 public:
83  ossimRpcSolver(bool useElevation=false,
84  bool useHeightAboveMSLFlag=false);
85 
86  virtual ~ossimRpcSolver(){}
87 
91  void solveCoefficients(const ossimDrect& imageBounds,
92  ossimProjection* imageProj,
93  ossim_uint32 xSamples=8,
94  ossim_uint32 ySamples=8);
95 
96  void solveCoefficients(const ossimDrect& imageBounds,
97  ossimImageGeometry* geom,
98  ossim_uint32 xSamples=8,
99  ossim_uint32 ySamples=8);
100 
112  bool solve(const ossimDrect& aoiBounds,
113  ossimImageGeometry* geom,
114  const double& pixel_tolerance=0.5);
115 
120  bool solve(const ossimFilename& imageFilename,
121  const double& pixel_tolerance=0.5);
122 
131  void solveCoefficients(const std::vector<ossimDpt>& imagePoints,
132  const std::vector<ossimGpt>& groundControlPoints);
133 
138  const ossimRefPtr<ossimRpcModel> getRpcModel() const { return theRpcModel; }
139 
140  double getRmsError()const;
141  double getMaxError()const;
142 
148  ossimRefPtr<ossimNitfRegisteredTag> getNitfRpcBTag() const;
149 
153  void setValidImageRect(const ossimIrect& imageRect);
154 
155 protected:
156  virtual void solveInitialCoefficients(NEWMAT::ColumnVector& coeff,
157  const std::vector<double>& f,
158  const std::vector<double>& x,
159  const std::vector<double>& y,
160  const std::vector<double>& z)const;
161 
162  virtual void solveCoefficients(NEWMAT::ColumnVector& coeff,
163  const std::vector<double>& f,
164  const std::vector<double>& x,
165  const std::vector<double>& y,
166  const std::vector<double>& z)const;
167 
168  double eval(const std::vector<double>& coeff,
169  const double& x, const double& y, const double& z)const;
170 
171  void evalPoint(const ossimGpt& gpt, ossimDpt& ipt) const;
172 
176  NEWMAT::Matrix invert(const NEWMAT::Matrix& m)const;
177 
178  void setupSystemOfEquations(NEWMAT::Matrix& equations,
179  const NEWMAT::ColumnVector& f,
180  const std::vector<double>& x,
181  const std::vector<double>& y,
182  const std::vector<double>& z)const;
183 
184  void setupWeightMatrix(NEWMAT::DiagonalMatrix& result, // holds the resulting weights
185  const NEWMAT::ColumnVector& coefficients,
186  const NEWMAT::ColumnVector& f,
187  const std::vector<double>& x,
188  const std::vector<double>& y,
189  const std::vector<double>& z)const;
190 
197 
198 };
199 
200 #endif
ossim_uint32 x
ossim_uint32 y
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less i...
const ossimRefPtr< ossimRpcModel > getRpcModel() const
Fetches the solved-for RPC model.
double ossim_float64
virtual ~ossimRpcSolver()
ossim_float64 theMaxResidual
unsigned int ossim_uint32
ossimRefPtr< ossimRpcModel > theRpcModel
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
ossim_float64 theMeanResidual
bool theHeightAboveMSLFlag
#define OSSIM_DLL
This currently only support Rational poilynomial B format.
ossimRefPtr< ossimImageGeometry > theRefGeom