OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
TiePoint.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 
8 #ifndef TiePoint_HEADER
9 #define TiePoint_HEADER 1
10 
12 #include <ossim/reg/Image.h>
13 #include <ossim/base/ossimDpt.h>
15 #include <ossim/matrix/newmat.h>
16 #include <vector>
17 #include <memory>
18 
19 namespace ossim
20 {
21 class TiePoint;
22 typedef std::vector< std::shared_ptr<TiePoint> > TiePointList;
23 
29  public std::enable_shared_from_this<TiePoint>
30 {
31 public:
32  enum Type {
34  MANUAL, //> The point was created or edited manually and contains at least a pair of image points
35  AUTO, //> Result of auto tie point generation and contains at least a pair of image points
36  GCP //> point is associated with a manually-entered ground control. Possibly multiple image points
37  };
38 
39  TiePoint();
40 
41  TiePoint(const TiePoint& copy);
42 
59  TiePoint(const Json::Value& tp_json_node);
60 
61  virtual ~TiePoint();
62 
63  unsigned int getImageCount() const { return m_images.size(); }
64 
65  const std::string& getTiePointId() const { return m_tiePointId; }
66 
67  void setTiePointId(const std::string& id);
68 
76  void getImagePoint(unsigned int index,
77  std::string& imageId,
78  ossimDpt& imagePoint,
79  NEWMAT::SymmetricMatrix& cov) const;
80 
85  void setImagePoint(std::shared_ptr<Image> image,
86  const ossimDpt& imagePoint,
87  const NEWMAT::SymmetricMatrix& cov);
88 
89  Type getType() const { return m_type; }
90  void setType(Type t) { m_type = t; }
91 
92  const std::string& getGcpId() const { return m_gcpId; }
93  void setGcpId(const std::string& id);
94 
95  /*
96  * Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
97  * for JSON format used.
98  */
99  virtual void loadJSON(const Json::Value& json);
100 
101  /*
102  * Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
103  * for JSON format used.
104  */
105  virtual void saveJSON(Json::Value& json) const;
106 
107  virtual std::ostream& print(std::ostream& out) const;
109  { return tp.print(out); }
110 
111 protected:
112 
114  std::string m_tiePointId;
115  std::vector< std::shared_ptr<Image> > m_images; //> List of images containing common feature
116  std::vector<ossimDpt> m_imagePoints; //> List of image point measurements for common feature
117  std::vector<NEWMAT::SymmetricMatrix> m_covariances; //> List of measurement covariances corresponding to image points vector
118  double m_gsd; //> image scale (meters/pixel) at which matching was performed
119  std::string m_gcpId; //> Cross reference to GCP record associated with this TP.
120  static int s_runningId;
121 };
122 
123 typedef std::vector< std::shared_ptr<TiePoint> > TiePointList;
124 
125 } // end namespace ATP
126 #endif /* #ifndef TiePoint_HEADER */
virtual void saveJSON(Json::Value &json) const
Definition: TiePoint.cpp:195
std::vector< NEWMAT::SymmetricMatrix > m_covariances
Definition: TiePoint.h:117
unsigned int getImageCount() const
Definition: TiePoint.h:63
This code was derived from https://gist.github.com/mshockwave.
Definition: Barrier.h:8
void getImagePoint(unsigned int index, std::string &imageId, ossimDpt &imagePoint, NEWMAT::SymmetricMatrix &cov) const
Fetches the image point coordinates along with image ID and GCP ID if available.
Definition: TiePoint.cpp:70
double m_gsd
Definition: TiePoint.h:118
std::vector< ossimDpt > m_imagePoints
Definition: TiePoint.h:116
void setTiePointId(const std::string &id)
Definition: TiePoint.cpp:54
const std::string & getGcpId() const
Definition: TiePoint.h:92
static int s_runningId
Definition: TiePoint.h:120
std::string m_tiePointId
Definition: TiePoint.h:114
std::vector< std::shared_ptr< TiePoint > > TiePointList
Definition: TiePoint.h:21
friend std::ostream & operator<<(std::ostream &out, const TiePoint &tp)
Definition: TiePoint.h:108
void setGcpId(const std::string &id)
Definition: TiePoint.cpp:120
void setType(Type t)
Definition: TiePoint.h:90
std::vector< std::shared_ptr< Image > > m_images
Definition: TiePoint.h:115
const std::string & getTiePointId() const
Definition: TiePoint.h:65
Pure virtual interface for classes implementing JSON-based load/save state.
Definition: JsonInterface.h:19
virtual void loadJSON(const Json::Value &json)
Definition: TiePoint.cpp:126
Type getType() const
Definition: TiePoint.h:89
Class for representing a single tiepoint on two or more images.
Definition: TiePoint.h:28
virtual std::ostream & print(std::ostream &out) const
Definition: TiePoint.cpp:239
void setImagePoint(std::shared_ptr< Image > image, const ossimDpt &imagePoint, const NEWMAT::SymmetricMatrix &cov)
Sets image point value and associated measurement covariance for specified image ID.
Definition: TiePoint.cpp:88
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
std::string m_gcpId
Definition: TiePoint.h:119
virtual ~TiePoint()
Definition: TiePoint.cpp:47