OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimLeastSquaresPlane.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks.com
6 //
7 // Description: Source code produced by Dave Knopp
8 //
9 //*******************************************************************
10 // $Id: ossimLeastSquaresPlane.h 23167 2015-02-24 22:07:14Z okramer $
11 #ifndef ossimLeastSquaresPlane_INCLUDE
12 #define ossimLeastSquaresPlane_INCLUDE
14 #include <ossim/matrix/newmat.h>
15 
28 {
29 public:
30 
36 
37  ossimLeastSquaresPlane & operator = (const ossimLeastSquaresPlane &);
38 
42  virtual ~ossimLeastSquaresPlane();
43 
49  virtual void clear();
50 
58  virtual void addSample(double x, double y, double z_mea);
59 
67  virtual bool getLSParms(double& pa, double& pb, double& pc) const;
68 
74  virtual void setLSParams(double pa, double pb, double pc);
75 
83  virtual inline double lsFitValue(double xx, double yy) const { return (m_a*xx + m_b*yy + m_c); }
84 
88  bool solveLS();
89 
90 private:
91 
95  double m_a;
96 
100  double m_b;
101 
105  double m_c;
106 
110  NEWMAT::Matrix* AtA;
111 
115  NEWMAT::Matrix* Atb;
116 
118 };
119 
120 #endif
121 
ossim_uint32 x
double m_b
linear-Y term.
#define OSSIMDLLEXPORT
ossim_uint32 y
double m_c
constant term.
unsigned int ossim_uint32
double m_a
linear-X term.
NEWMAT::Matrix * AtA
Normal system coefficient matrix.
NEWMAT::Matrix * Atb
Normal system RHS vector.
Provide 2D Least Squares Plane model fitting The math model is that of a plane of the form: ...
virtual double lsFitValue(double xx, double yy) const
interpolate LS-fit value at location (xx,yy) - returns z(xx,yy).