OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimPointObservation.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: Class container for multi-ray point observation.
8 //----------------------------------------------------------------------------
9 #ifndef ossimPointObservation_HEADER
10 #define ossimPointObservation_HEADER
11 
12 #include <iostream>
13 #include <vector>
14 #include <ossim/base/ossimGpt.h>
15 #include <ossim/base/ossimDpt.h>
16 #include <ossim/base/ossimObject.h>
17 #include <ossim/base/ossimRefPtr.h>
22 
23 
25 {
26 public:
27 
29 
31 
33  const ossimString& anID,
34  const ossimColumnVector3d& latLonHgtSigmas);
35 
37 
39 
40  void reset();
41 
42  inline ossimGpt& Gpt() { return thePt; }
43  inline ossimString ID()const { return theID; }
44  inline void setID(const std::string& anID) { theID=anID; }
45  inline unsigned int numImages()const { return (unsigned int)theImageFiles.size(); }
46  inline unsigned int numMeas()const { return (unsigned int)theMeas.size(); }
47 
48  // Image geometry access
49  ossimImageGeometry* getImageGeom(const int index);
50  void setImageGeom(const int index, ossimImageGeometry* imgGeom);
51 
52  // Image file access
53  inline ossimFilename imageFile(const int index)const { return theImageFiles[index]; }
54 
55  // Measurement addition
56  void addMeasurement(const ossimDpt& meas,
57  const ossimFilename& imgFile,
58  const ossimDpt& measSigma = ossimDpt(1.0,1.0));
59  void addMeasurement(const double& x,
60  const double& y,
61  const std::string& imgFile,
62  const ossimDpt& measSigma = ossimDpt(1.0,1.0));
63 
64  // Measurement access
65  void getResiduals(const int index, NEWMAT::Matrix& resid);
66 
67  void getMeasCov(const int index, NEWMAT::Matrix& cov)const;
68  void getObsCov(NEWMAT::Matrix& cov)const;
69 
70  void getMeasurement(const int index, NEWMAT::Matrix& meas)const;
71  inline ossimDpt getMeasurement(const int index)const { return theMeas[index]; }
72 
73  inline int numPars(const int index)const { return theNumPars[index]; }
74 
75 
76  // Partial derivative access
77  void getParameterPartials(const int index, NEWMAT::Matrix& parPartials);
78  void getObjSpacePartials(const int index, NEWMAT::Matrix& objPartials);
79 
80 
82 
83  inline void setGroundPoint(const double& lat,
84  const double& lon,
85  const double& hgt)
86  {
87  thePt.latd(lat);
88  thePt.lond(lon);
89  thePt.height(hgt);
90  }
91 
92  inline void setGroundSigmas(const double& latSig,
93  const double& lonSig,
94  const double& hgtSig)
95  {
96  theObsSigmas[0] = latSig;
97  theObsSigmas[1] = lonSig;
98  theObsSigmas[2] = hgtSig;
99  }
100 
101  inline void setGroundPoint(const ossimGpt& mPt) { thePt = mPt; }
102  inline const ossimGpt& getGroundPoint()const { return thePt; }
103  inline ossimGpt& refGroundPoint() { return thePt; }
104 
105  // Note: Member variable "theScore" is currently unused. Eventually, it is
106  // intended as a figure-of-merit representation.
107  inline void setScore(const double& s) { theScore = s; }
108  inline const double& getScore()const { return theScore; }
109  inline double& refScore() { return theScore; }
110 
111  void makeNan()
112  {
113  thePt.makeNan();
114  theScore=ossim::nan();
115  }
116 
117  bool hasNans()const
118  {
119  return (thePt.hasNans() || (ossim::isnan(theScore)));
120  }
121 
122  bool isNan()const
123  {
124  return (thePt.isNan() && (ossim::isnan(theScore)));
125  }
126  std::ostream& print(std::ostream& os) const;
127 
129  const ossimPointObservation& pt);
138 
139 protected:
142  double theObsSigmas[3];
143  double theScore;
144 
145  std::vector<ossimDpt> theMeas;
146  std::vector<ossimDpt> theMeasSigmas;
147  std::vector<ossimFilename> theImageFiles;
148  std::vector<int> theNumPars;
149  std::vector< ossimRefPtr<ossimImageHandler> > theImageHandlers;
150 };
151 
152 #endif // #ifndef ossimPointObservation_HEADER
ossim_uint32 x
std::vector< ossimFilename > theImageFiles
void setScore(const double &s)
#define OSSIMDLLEXPORT
std::vector< int > theNumPars
void setGroundPoint(const double &lat, const double &lon, const double &hgt)
ossim_uint32 y
std::vector< ossimDpt > theMeas
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
void setGroundPoint(const ossimGpt &mPt)
friend OSSIMDLLEXPORT std::ostream & operator<<(std::ostream &out, const ossimObject &obj)
void setID(const std::string &anID)
const double & getScore() const
virtual std::ostream & print(std::ostream &out) const
Generic print method.
std::vector< ossimRefPtr< ossimImageHandler > > theImageHandlers
ossimDpt getMeasurement(const int index) const
int numPars(const int index) const
void setGroundSigmas(const double &latSig, const double &lonSig, const double &hgtSig)
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
unsigned int numImages() const
ossimFilename imageFile(const int index) const
const ossimGpt & getGroundPoint() const
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
ossimReferenced & operator=(const ossimReferenced &)
#define OSSIM_DLL
unsigned int numMeas() const
ossimString ID() const
std::vector< ossimDpt > theMeasSigmas
OSSIM_DLL void operator>>(ossimIStream &in, ossimOStream &out)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91