OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimPositionQualityEvaluator.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: David Hicks
6 //
7 // Description: Base class for position quality evaluation operations.
8 //----------------------------------------------------------------------------
9 #ifndef ossimPositionQualityEvaluator_HEADER
10 #define ossimPositionQualityEvaluator_HEADER
11 
12 #include <ossim/base/ossimDpt.h>
14 #include <ossim/base/ossimGpt.h>
18 #include <ossim/matrix/newmat.h>
19 #include <ossim/matrix/newmatap.h>
20 #include <ossim/matrix/newmatio.h>
21 
22 
23 // Probability level specifiers
25 {
26  ONE_SIGMA = 0,
27  P50,
28  P90,
29  P95,
31 };
32 
33 // Ground space ellipse
35 {
38  double theAzimAngle;
40 };
41 
42 // RPC model parameters
44 {
45  double theLineScale;
46  double theSampScale;
47  double theLatScale;
48  double theLonScale;
49  double theHgtScale;
50  double theLineOffset;
51  double theSampOffset;
52  double theLatOffset;
53  double theLonOffset;
54  double theHgtOffset;
55  double theLineNumCoef[20];
56  double theLineDenCoef[20];
57  double theSampNumCoef[20];
58  double theSampDenCoef[20];
59  char theType; // A or B
60 };
61 
62 // Image space ellipse point set
63 typedef std::vector<ossimDpt> pqeImageErrorEllipse_t;
64 
65 
66 
68 {
69 public:
70 
73 
80  const ossimEcefPoint& pt,
81  const NEWMAT::Matrix& covMat);
82 
94  const ossimEcefPoint& pt,
95  const ossim_float64& errBiasLOS,
96  const ossim_float64& errRandLOS,
97  const ossim_float64& elevAngleLOS,
98  const ossim_float64& azimAngleLOS,
99  const ossimColumnVector3d& surfN = ossimColumnVector3d(0,0,1),
100  const NEWMAT::Matrix& surfCovMat = ossimMatrix3x3::createZero());
101 
112  const ossimEcefPoint& pt,
113  const ossim_float64& errBiasLOS,
114  const ossim_float64& errRandLOS,
115  const pqeRPCModel& rpc,
116  const ossimColumnVector3d& surfN = ossimColumnVector3d(0,0,1),
117  const NEWMAT::Matrix& surfCovMat = ossimMatrix3x3::createZero());
118 
121 
129  bool addContributingCovariance(
130  NEWMAT::Matrix& covMat);
131 
140  bool addContributingCE_LE(
141  const ossim_float64& cCE,
142  const ossim_float64& cLE);
143 
151  bool subtractContributingCovariance(
152  NEWMAT::Matrix& covMat);
153 
162  bool subtractContributingCE_LE(
163  const ossim_float64& cCE,
164  const ossim_float64& cLE);
165 
173  bool getCovMatrix(
174  NEWMAT::Matrix& covMat) const;
175 
185  bool computeCE_LE(
186  const pqeProbLev_t pLev,
187  ossim_float64& CE,
188  ossim_float64& LE) const;
189 
190 
199  bool extractErrorEllipse(
200  const pqeProbLev_t pLev,
201  pqeErrorEllipse& ellipse);
202 
203 
214  bool extractErrorEllipse(
215  const pqeProbLev_t pLev,
216  const ossim_float64& angularIncrement,
217  pqeErrorEllipse& ellipse,
218  pqeImageErrorEllipse_t& ellImage);
219 
220 
224  inline bool isValid() const { return theEvaluatorValid; }
225 
226 
230  std::ostream& print(std::ostream& out) const;
231 
232 protected:
233 
234 private:
235  //***
236  // Members
237  //***
240  NEWMAT::Matrix theCovMat; //local ENU frame
243  NEWMAT::Matrix theEigenvectors;
245 
246  //***
247  // Method for eigenvector decomposition of covariance matrix
248  //***
249  bool decomposeMatrix();
250 
251  //***
252  // Method for covariance matrix formation from 1-sigma LOS
253  // error componenents and imaging geometry
254  //***
255  bool constructMatrix(const ossim_float64& errBiasLOS,
256  const ossim_float64& errRandLOS,
257  const ossim_float64& elevAngleLOS,
258  const ossim_float64& azimAngleLOS,
259  const ossimColumnVector3d& surfN,
260  const NEWMAT::Matrix& surfCovMat);
261 
262  //***
263  // Method for forming 3X3 ENU covariance matrix from CE/LE
264  //***
265  bool formCovMatrixFromCE_LE(const ossim_float64& CE,
266  const ossim_float64& LE,
267  NEWMAT::Matrix& covMat) const;
268 
269  //***
270  // Method for computing 90% CE using interpolating function
271  //***
272  double compute90PCE() const;
273 
274  //***
275  // Method for computing acquisition angles from RPC coefficients
276  //***
277  bool computeElevAzim(const pqeRPCModel rpc,
278  ossim_float64& elevAngleLOS,
279  ossim_float64& azimAngleLOS) const;
280 
281  //***
282  // Methods for computing RPC polynomial and its derivatives
283  //***
284  double polynomial(const double& nlat,
285  const double& nlon,
286  const double& nhgt,
287  const double* coeffs) const;
288  double dPoly_dLat(const double& nlat,
289  const double& nlon,
290  const double& nhgt,
291  const double* coeffs) const;
292  double dPoly_dLon(const double& nlat,
293  const double& nlon,
294  const double& nhgt,
295  const double* coeffs) const;
296  double dPoly_dHgt(const double& nlat,
297  const double& nlon,
298  const double& nhgt,
299  const double* coeffs) const;
300 
301 
302 
303  //***
304  // Utility methods
305  //***
307  const ossimColumnVector3d& v2) const;
308 
309  double atan3(const ossim_float64 y, const ossim_float64 x) const;
310 
311 };
312 
313 #endif /* #ifndef ossimPositionQualityEvaluator_HEADER */
ossim_uint32 x
std::vector< ossimDpt > pqeImageErrorEllipse_t
static NEWMAT::Matrix createZero()
ossim_uint32 y
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
Definition: ossimH5Util.cpp:41
double ossim_float64
#define OSSIM_DLL
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23