OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
AtpGenerator.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 #ifndef AtpGeneratorBase_H_
8 #define AtpGeneratorBase_H_
9 
12 #include <ossim/base/ossimRefPtr.h>
17 #include <ossim/reg/Image.h>
18 #include "AtpTileSource.h"
19 #include "AutoTiePoint.h"
20 #include "AtpAnnotatedImage.h"
21 #include <vector>
22 #include <memory>
23 
24 namespace ATP
25 {
26 
33 class AtpGenerator : public std::enable_shared_from_this<AtpGenerator>
34 {
35  friend class AtpTileSource;
36 
37 public:
39 
40  AtpGenerator(Algorithm algo);
41 
42  virtual ~AtpGenerator();
43 
44  void setRefImage(std::shared_ptr<ossim::Image> ref_image);
45  void setCmpImage(std::shared_ptr<ossim::Image> cmp_image);
46 
48  virtual void initialize();
49 
54  void setBandWeights(const std::vector<double> weights) { m_bandWeights = weights; }
55 
62  virtual bool generateTiePointList(ossim::TiePointList& tpList);
63 
72 // virtual bool renderTiePointDataAsImages(const ossimFilename& outBaseName,
73 // const ossimFilename& lutFile=ossimFilename("")) = 0;
74 
78  static void writeTiePointList(ostream& out, const AtpList& tpList);
79 
84 
85  std::string getRefImageID();
86  std::string getCmpImageID();
87  std::string getRefFilename();
88  std::string getCmpFilename();
89 
90  ossimRefPtr<AtpTileSource> getAtpTileSource() { return m_atpTileSource; } // For engineering use
93 
94 protected:
96 
102  constructChain(std::shared_ptr<ossim::Image> image,
104 
106  // @return true if successful
109  std::vector<ossimDpt>& validVertices);
110 
112  void layoutSearchTileRects(ossimPolygon& overlapPoly);
113 
115 
117  std::shared_ptr<ossim::Image> m_refImage;
118  std::shared_ptr<ossim::Image> m_cmpImage;
126  std::vector<double> m_bandWeights;
128  std::vector<ossimIrect> m_searchTileRects;
129  static std::shared_ptr<AutoTiePoint> s_referenceATP;
130 
131 };
132 }
133 #endif /* AtpGeneratorBase_H_ */
bool getValidVertices(ossimRefPtr< ossimImageChain > chain, ossimRefPtr< ossimImageViewProjectionTransform > &ivt, std::vector< ossimDpt > &validVertices)
Establishes valid image vertices in view space for later computing overlap.
ossimIrect m_aoiView
Definition: AtpGenerator.h:125
virtual ossimRefPtr< ossimImageChain > constructChain(std::shared_ptr< ossim::Image > image, ossimRefPtr< ossimImageViewProjectionTransform > &ivt)
Constructs the processing chain for the input image according to the needs of the generator...
ossimRefPtr< ossimImageChain > getCmpChain()
Definition: AtpGenerator.h:83
std::shared_ptr< ossim::Image > m_cmpImage
Definition: AtpGenerator.h:118
std::string getCmpFilename()
virtual void initialize()
Needs to be called after ref and cmp images are set.
std::shared_ptr< ossim::Image > m_refImage
Definition: AtpGenerator.h:117
Base class for tile sources performing auto tie point extraction.
Definition: AtpTileSource.h:26
std::vector< double > m_bandWeights
Definition: AtpGenerator.h:126
std::vector< std::shared_ptr< AutoTiePoint > > AtpList
Definition: AutoTiePoint.h:137
ossimRefPtr< ossimImageViewProjectionTransform > m_refIVT
Definition: AtpGenerator.h:122
ossimRefPtr< ossimImageChain > m_refChain
Definition: AtpGenerator.h:120
ossimRefPtr< ossimImageViewProjectionTransform > getCmpIVT()
Definition: AtpGenerator.h:81
virtual bool generateTiePointList(ossim::TiePointList &tpList)
This is the main workhorse method.
ossimRefPtr< AtpTileSource > getAtpTileSource()
Definition: AtpGenerator.h:90
ossimRefPtr< ossimImageChain > getRefChain()
Definition: AtpGenerator.h:82
std::string getRefFilename()
ossimRefPtr< ossimImageChain > m_cmpChain
Definition: AtpGenerator.h:121
ossimRefPtr< AtpAnnotatedImage > m_annotatedCmpImage
Definition: AtpGenerator.h:92
std::vector< std::shared_ptr< TiePoint > > TiePointList
Definition: TiePoint.h:21
std::string getRefImageID()
Base class for OSSIM-based ATP generators.
Definition: AtpGenerator.h:33
ossimRefPtr< AtpTileSource > m_atpTileSource
Definition: AtpGenerator.h:119
ossimRefPtr< ossimImageViewProjectionTransform > getRefIVT()
Definition: AtpGenerator.h:80
virtual ~AtpGenerator()
THESE FUNCTIONS REQUIRE OPENCV.
void setBandWeights(const std::vector< double > weights)
When the input images are multiband, the bands must be combined into a single-band image...
Definition: AtpGenerator.h:54
void layoutSearchTileRects(ossimPolygon &overlapPoly)
Finds optimum layout of patches within the intersect area for feature search.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
ossimRefPtr< AtpAnnotatedImage > m_annotatedRefImage
Definition: AtpGenerator.h:91
ossimRefPtr< ossimImageGeometry > m_viewGeom
Definition: AtpGenerator.h:124
static std::shared_ptr< AutoTiePoint > s_referenceATP
Definition: AtpGenerator.h:129
ossimImageHandler * getImageHandler(ossimRefPtr< ossimImageChain > &chain)
Algorithm m_algorithm
Definition: AtpGenerator.h:116
std::string getCmpImageID()
void setRefImage(std::shared_ptr< ossim::Image > ref_image)
std::vector< ossimIrect > m_searchTileRects
Definition: AtpGenerator.h:128
ossimRefPtr< ossimImageViewProjectionTransform > m_cmpIVT
Definition: AtpGenerator.h:123
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
void setCmpImage(std::shared_ptr< ossim::Image > cmp_image)
static void writeTiePointList(ostream &out, const AtpList &tpList)
For engineering use.