OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimRpcProjection.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // FILE: ossimRpcProjection.h
3 //
4 // MIT
5 //
6 // DESCRIPTION: Contains declaration of class ossimRpcProjection.
7 // This is a replacement model utilizing the Rational Polynomial Coefficients
8 // (RPC), a.k.a. Rapid Positioning Capability, and Universal Sensor Model
9 // (USM).
10 //
11 //*****************************************************************************
12 // $Id: ossimRpcProjection.h 11805 2007-10-05 14:54:28Z dburken $
13 
14 #ifndef ossimRpcProjection_HEADER
15 #define ossimRpcProjection_HEADER
16 
20 #include <ossim/base/ossimIpt.h>
21 #include <ossim/matrix/newmat.h>
22 
23 /*!****************************************************************************
24  *
25  * CLASS: ossimRpcProjection
26  *
27  *****************************************************************************/
31 {
32 public:
33  //***
34  // Enumeration of supported RPC polynomial formats:
35  //***
37  {
38  A='A', // corresponds to "RPC00A"
39  B='B' // corresponds to "RPC00B"
40  };
41 
46  ossimRpcProjection(const ossimRpcProjection& copy_this);
48 
50 
52  virtual void adjustableParametersChanged();
53 
54  virtual ossimObject* getBaseObject();
55  virtual const ossimObject* getBaseObject()const;
56 
57  void setAttributes(ossim_float64 theSampleOffset,
58  ossim_float64 theLineOffset,
59  ossim_float64 theSampleScale,
60  ossim_float64 theLineScale,
61  ossim_float64 theLatOffset,
62  ossim_float64 theLonOffset,
63  ossim_float64 theHeightOffset,
64  ossim_float64 theLatScale,
65  ossim_float64 theLonScale,
66  ossim_float64 theHeightScale,
67  const std::vector<double>& xNumeratorCoeffs,
68  const std::vector<double>& xDenominatorCoeffs,
69  const std::vector<double>& yNumeratorCoeffs,
70  const std::vector<double>& yDenominatorCoeffs,
71  PolynomialType polyType = B);
72 
78  virtual void worldToLineSample(const ossimGpt& world_point,
79  ossimDpt& image_point) const;
84  virtual std::ostream& print(std::ostream& out) const;
85 
91  virtual bool saveState(ossimKeywordlist& kwl,
92  const char* prefix=0) const;
93 
94  virtual bool loadState(const ossimKeywordlist& kwl,
95  const char* prefix=0);
96 
97  virtual void lineSampleToWorld(const ossimDpt& image_point,
98  ossimGpt& world_point) const;
99  //***
100  // METHOD: lineSampleHeightToWorld()
101  // Overrides base class pure virtual. Height understood to be relative to
102  // standard ellipsoid.
103  //***
104  virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
105  const double& heightEllipsoid,
106  ossimGpt& worldPoint) const;
107 
112  virtual ossimObject* dup() const { return new ossimRpcProjection(*this); }
113 
114  virtual ossimGpt origin()const;
115  virtual ossimDpt getMetersPerPixel() const;
116  virtual bool operator==(const ossimProjection& projection) const;
117 
118  /*
119  * optimizable interface
120  */
121  virtual bool setupOptimizer(const ossimString& setup);
122  inline virtual bool useForward()const {return true;}
123  virtual ossim_uint32 degreesOfFreedom()const;
124  virtual double optimizeFit(const ossimTieGptSet& tieSet, double* targetVariance=NULL);
131  virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt& gpos, double hdelta=1e-11);
132 
139  virtual ossimGpt getInverseDeriv(int parmIdx, const ossimDpt& ipos, double hdelta=1e-11);
140 
146  virtual bool isAffectedByElevation() const { return true; }
147 
148 protected:
149  //***
150  // Methods for computing RPC polynomial and its derivatives:
151  //***
152  double polynomial(const double& nlat,
153  const double& nlon,
154  const double& nhgt,
155  const double* coeffs) const;
156  double dPoly_dLat(const double& nlat,
157  const double& nlon,
158  const double& nhgt,
159  const double* coeffs) const;
160  double dPoly_dLon(const double& nlat,
161  const double& nlon,
162  const double& nhgt,
163  const double* coeffs) const;
164 
181  void buildNormalEquation(const ossimTieGptSet& tieSet,
182  NEWMAT::SymmetricMatrix& A,
183  NEWMAT::ColumnVector& residue,
184  NEWMAT::ColumnVector& projResidue,
185  double pstep_scale);
186 
191  NEWMAT::ColumnVector getResidue(const ossimTieGptSet& tieSet);
192 
193  NEWMAT::ColumnVector solveLeastSquares(NEWMAT::SymmetricMatrix& A, NEWMAT::ColumnVector& r)const;
194 
198  NEWMAT::Matrix invert(const NEWMAT::Matrix& m)const;
199 
201  //***
202  // Quantities for zero-biasing and normalizing the image point and
203  // ground point coordinates referenced in the polynomials:
204  //***
205  double theLineScale;
206  double theSampScale;
207  double theLatScale;
208  double theLonScale;
209  double theHgtScale;
212  double theLatOffset;
213  double theLonOffset;
214  double theHgtOffset;
215 
216  //***
217  // Coefficients:
218  //***
219  double theLineNumCoef[20];
220  double theLineDenCoef[20];
221  double theSampNumCoef[20];
222  double theSampDenCoef[20];
223 
224  //*
225  // Quantities derived from the adjustable parameters:
226  //*
231  double theYawSkew; // = sin(theYawOffset)
232  double theCosMapRot;
233  double theSinMapRot;
234 
235  TYPE_DATA
236 };
237 
238 #endif
virtual ossimObject * dup() const
virtual bool isAffectedByElevation() const
Implementation of pure virtual ossimProjection::isAffectedByElevation method.
virtual bool setupOptimizer(const ossimString &setup)
setupFromString() Derived classes should implement as needed. Initialize parameters needed for optimi...
Represents serializable keyword/value map.
virtual ossim_uint32 degreesOfFreedom() const =0
virtual double optimizeFit(const ossimTieGptSet &tieSet, double *targetVariance=0)=0
#define A(r, c)
double ossim_float64
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual class enabling projection optimization (can be used for outlier rejection - RANSAC) ...
#define TYPE_DATA
Definition: ossimRtti.h:339
virtual ossimDpt getMetersPerPixel() const =0
virtual void lineSampleHeightToWorld(const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const =0
unsigned int ossim_uint32
virtual bool useForward() const
bool operator==(const ossimRefPtr< _Tp1 > &__a, const ossimRefPtr< _Tp2 > &__b) noexcept
Definition: ossimRefPtr.h:101
PolynomialType thePolyType
virtual ossimGpt origin() const =0
storage class for a set of geographic tie points, between master and slave images ...
#define OSSIM_DLL
std::ostream & print(std::ostream &out) const
Dumps the currently active adjustment to ostream.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual ossimObject * getBaseObject()=0
const ossimAdjustableParameterInterface & operator=(const ossimAdjustableParameterInterface &rhs)
virtual void lineSampleToWorld(const ossimDpt &lineSampPt, ossimGpt &worldPt) const =0
virtual void worldToLineSample(const ossimGpt &worldPoint, ossimDpt &lineSampPt) const =0
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23