OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
AutoTiePoint.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 #pragma once
8 
9 #include <vector>
10 #include <memory>
11 #include <string>
12 #include <ossim/base/ossimDpt.h>
15 #include <ossim/base/ossimIrect.h>
16 #include <ossim/reg/TiePoint.h>
17 #include "MatchPoint.h"
18 
19 
20 namespace ATP
21 {
22 class AtpGenerator;
23 
31 {
32 public:
33  AutoTiePoint ();
34 
35  AutoTiePoint (const AutoTiePoint& copy_me);
36 
43  AutoTiePoint(std::shared_ptr<AtpGenerator> generator, const std::string& id);
44 
61  AutoTiePoint(const Json::Value& tp_json_node);
62 
63  virtual ~AutoTiePoint();
64 
66  void setRefImagePt(const ossimDpt& imagePt);
67 
69  void setRefViewPt(const ossimDpt& viewPt);
70 
73  bool getVectorResidual(ossimDpt& residual) const;
74 
77  bool getRefImagePoint(ossimDpt& image_pt) const;
78 
80  bool getCmpImagePoint(ossimDpt& image_pt) const;
81 
83  virtual std::ostream& print(std::ostream& out) const;
84 
86  std::vector<MatchPoint>& matchPoints() { return m_matchPoints; }
87 
89  void addImageMatch(const ossimDpt& cmpPt, double confidenceValue=1.0);
90 
92  void addViewMatch(const ossimDpt& cmpViewPt, double confidenceValue=1.0);
93 
95  unsigned int getNumMatches() const { return (unsigned int) m_matchPoints.size(); }
96 
98  bool hasValidMatch() const;
99 
101  bool getConfidenceMeasure(double &confidence) const;
102 
105  bool getRefViewPoint (ossimDpt& view_pt) const;
106 
109  bool getRefGroundPoint(ossimGpt& gpt) const;
110 
113  bool getCmpViewPoint (ossimDpt& view_pt, unsigned int peak_idx=0) const;
114 
117  bool bumpActiveMatch();
118  /*
119  * Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
120  * for JSON format used.
121  */
122  virtual void saveJSON(Json::Value& json) const;
123 
124 protected:
127  virtual void recomputeResidual();
128 
129  std::shared_ptr<AtpGenerator> m_generator;
130  std::vector<MatchPoint> m_matchPoints;
135 };
136 
137 typedef std::vector< std::shared_ptr<AutoTiePoint> > AtpList;
138 
139 }
void setRefViewPt(const ossimDpt &viewPt)
Sets the reference image&#39;s view point (in view space) for this tiepoint.
bool getRefImagePoint(ossimDpt &image_pt) const
Returns the center location of the reference patch (the feature) in image-space.
bool getVectorResidual(ossimDpt &residual) const
Returns the vector residual (CMP-REF) of current active peak (in view space) via argument.
bool getRefGroundPoint(ossimGpt &gpt) const
Returns the center location of the reference patch (the feature) in geographic.
Base class for all automatic tiepoints.
Definition: AutoTiePoint.h:30
ossimDpt m_refViewPt
Definition: AutoTiePoint.h:131
bool getConfidenceMeasure(double &confidence) const
Returns the correlation value of current active peak via argument. Returns true if valid...
std::vector< std::shared_ptr< AutoTiePoint > > AtpList
Definition: AutoTiePoint.h:137
bool hasValidMatch() const
Returns true if there is a valid peak in the list.
void setRefImagePt(const ossimDpt &imagePt)
Sets the reference image&#39;s image point (in image space) for this tiepoint.
std::vector< MatchPoint > & matchPoints()
Access to peaks list for GUI debug display.
Definition: AutoTiePoint.h:86
bool bumpActiveMatch()
Removes the active match and sets the next peak as active.
virtual ~AutoTiePoint()
std::vector< MatchPoint > m_matchPoints
Definition: AutoTiePoint.h:130
double m_relativeError
Uncertainty in position of feature in CMP image.
Definition: AutoTiePoint.h:134
ossimDpt m_cmpViewPt
Definition: AutoTiePoint.h:132
std::shared_ptr< AtpGenerator > m_generator
Definition: AutoTiePoint.h:129
virtual void recomputeResidual()
Recomputes active peak&#39;s residual after a model adjustment or change in peak.
void addImageMatch(const ossimDpt &cmpPt, double confidenceValue=1.0)
Inserts match in image space by confidence in descending order.
THESE FUNCTIONS REQUIRE OPENCV.
virtual void saveJSON(Json::Value &json) const
void addViewMatch(const ossimDpt &cmpViewPt, double confidenceValue=1.0)
Inserts match in image space by confidence in descending order.
bool getRefViewPoint(ossimDpt &view_pt) const
Returns the center location of the reference patch (the feature) in view-space.
virtual std::ostream & print(std::ostream &out) const
Stream output dump of object.
bool getCmpViewPoint(ossimDpt &view_pt, unsigned int peak_idx=0) const
Fetches the comparison view point for current best peak, or for the peak indicated if provided...
bool getCmpImagePoint(ossimDpt &image_pt) const
Fetches the comparison image point for current best peak. Returns false if no valid peak...
unsigned int getNumMatches() const
Returns the total number of peaks in the list.
Definition: AutoTiePoint.h:95
Class for representing a single tiepoint on two or more images.
Definition: TiePoint.h:28
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23