OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
AtpGenerator.cpp
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 #include "AtpGenerator.h"
8 #include "AtpConfig.h"
9 #include "AtpTileSource.h"
10 #include "../AtpCommon.h"
11 #include "ossimCorrelationSource.h"
12 #include "ossimDescriptorSource.h"
28 
29 using namespace std;
30 using namespace ossim;
31 
32 #define DEBUG_ATP
33 
34 namespace ATP
35 {
36 std::shared_ptr<AutoTiePoint> AtpGenerator::s_referenceATP;
37 
38 
39 AtpGenerator::AtpGenerator(Algorithm algo)
40 : m_algorithm (algo),
41  m_refEllipHgt(0)
42 {
43 }
44 
45 
47 {
48 }
49 
50 
51 void AtpGenerator::setRefImage(shared_ptr<Image> ref_image)
52 {
53  m_refImage = ref_image;
54 }
55 
56 
57 void AtpGenerator::setCmpImage(shared_ptr<Image> cmp_image)
58 {
59  m_cmpImage = cmp_image;
60 }
61 
62 
64 {
66  if (!handler)
67  return "";
68  return handler->getImageID().string();
69 }
70 
72 {
74  if (!handler)
75  return "";
76  return handler->getImageID().string();
77 }
78 
80 {
82  if (!handler)
83  return "";
84  return handler->getFilename().string();
85 }
86 
88 {
90  if (!handler)
91  return "";
92  return handler->getFilename().string();
93 }
94 
96 {
97  if (!chain)
98  return 0;
99 
100  ossimTypeNameVisitor visitor ("ossimImageHandler");
101  chain->accept(visitor);
103 
104  return handler;
105 }
106 
107 
109 {
110  static const char* MODULE=" AtpGenerator::initialize() ";
111  AtpConfig &config = AtpConfig::instance();
112 
113  // Initialize the reference ATP containing the static data members used by all ATPs:
114  s_referenceATP.reset(new AutoTiePoint());
115  m_viewGeom = 0;
116 
117  // Establish image processing chains:
118  vector<ossimDpt> refVertices, cmpVertices;
121  if (!m_refChain || !m_cmpChain)
122  {
123  CFATAL<<MODULE<<"Null input chain(s)."<<endl;
124  return;
125  }
126 
127  if (config.diagnosticLevel(1))
128  {
129  CINFO<<"\n"<<MODULE<<"Initializing image pair with:"
130  <<"\n REF_ID: "<<m_refImage->getImageId()
131  <<"\n CMP_ID: "<<m_cmpImage->getImageId()<<endl;
132  }
133 
134  // Establish the actual overlap polygon and set AOI as its bounding rect:
135  getValidVertices(m_refChain, m_refIVT, refVertices);
136  getValidVertices(m_cmpChain, m_cmpIVT, cmpVertices);
137  ossimPolyArea2d refPoly (refVertices);
138  ossimPolyArea2d cmpPoly (cmpVertices);
139  ossimPolyArea2d overlapPoly (refPoly & cmpPoly);
140  vector<ossimPolygon> intersectPolys;
141  overlapPoly.getVisiblePolygons(intersectPolys);
142  if (intersectPolys.empty())
143  {
144  CINFO<<MODULE<<"No intersect polygon found."<<endl;
145  return;
146  }
147  ossimPolygon intersectPoly (intersectPolys[0]);
148 
149  ossimDrect viewDrect;
150  overlapPoly.getBoundingRect(viewDrect);
151  m_aoiView = viewDrect;
153 
154  if (config.diagnosticLevel(3))
155  {
156  ossimString basename (config.getParameter("annotatedImageBaseName").asString());
158  m_annotatedRefImage->setImageName(basename+"Ref.tif");
160  m_annotatedCmpImage->setImageName(basename+"Cmp.tif");
161  }
162 
163  // Establish the feature search tile locations:
164  layoutSearchTileRects(intersectPoly);
165 
166  // Establish the nominal height above ellipsoid for MSL at this location:
168  if (!refGeom)
169  {
170  CFATAL<<MODULE<<"Null ref image geometry."<<endl;
171  return;
172  }
173  ossimDpt viewCenter;
174  ossimGpt geoCenter;
175  m_aoiView.getCenter(viewCenter);
176  refGeom->localToWorld(viewCenter, geoCenter);
178  geoCenter.height(m_refEllipHgt); // Sea level
181 
182  // Now need the algorithm-specific tile source that does the pixel pulling:
183  switch (m_algorithm)
184  {
185  case CROSSCORR:
187  break;
188  case DESCRIPTOR:
190  break;
191  case NASA:
192  case ALGO_UNASSIGNED:
193  default:
194  CFATAL<<MODULE<<"Unhandled algorithm type."<<endl;
195  return;
196  }
197 
198  // Adjust AOI for half-width of correlation window -- this really should only apply to crosscorr,
199  // but descriptors also have a sampling window (just not readily known):
200  int patch_center = (config.getParameter("corrWindowSize").asUint() + 1) / 2;
201  ossimIpt first_pos(m_aoiView.ul().x + patch_center, m_aoiView.ul().y + patch_center);
202  ossimIpt last_pos(m_aoiView.lr().x - patch_center, m_aoiView.lr().y - patch_center);
203  m_aoiView.set_ul(first_pos);
204  m_aoiView.set_lr(last_pos);
205 
206  m_atpTileSource->initialize();
207 }
208 
209 
211 AtpGenerator::constructChain(shared_ptr<Image> image,
213 {
214  static const char *MODULE = "AtpGenerator::constructChain() ";
215  AtpConfig &config = AtpConfig::instance();
216 
218  ossimRefPtr<ossimImageHandler> handler = factory->open(image->getFilename());
219  if (!handler)
220  return NULL;
221  handler->setCurrentEntry(image->getEntryIndex());
222 
223  // Check if an imageID was provided in job JSON. otherwise, check if image handler can get it:
224  ossimString imageId = image->getImageId();
225  if (imageId.empty())
226  {
227  imageId = handler->getImageID();
228  if (imageId.empty())
229  imageId = image->getFilename();
230  }
231  handler->setImageID(imageId);
232  image->setImageId(imageId);
233 
234  if (config.diagnosticLevel(5))
235  {
236  ossimIrect vuRect;
237  handler->getImageGeometry()->getBoundingRect(vuRect);
238  CINFO << MODULE << "m_aoiView: " << vuRect << endl;;
239  }
240 
242  chain->add(handler.get());
243 
244  // Add histogram (experimental)
245  bool doHistogramStretch = config.getParameter("doHistogramStretch").asBool();
246  if (doHistogramStretch)
247  {
249  chain->add(histo_remapper.get());
252  if (!histogram)
253  {
254  handler->buildHistogram();
255  histogram = handler->getImageHistogram();
256  }
257  histo_remapper->setHistogram(histogram);
258 
259  // Need to select a band if multispectral:
260  unsigned int numBands = handler->getNumberOfOutputBands();
261  if (numBands > 1)
262  {
263  unsigned int band = image->getActiveBand();
264  if ((band > numBands) || (band <= 0))
265  {
266  CINFO << MODULE << "Specified band (" << band << ") is outside allowed range (1 to "
267  << numBands
268  << "). Using default band 1 which may not be ideal." << endl;
269  band = 1;
270  }
271  band--; // shift to zero-based
273  chain->add(band_selector.get());
274  vector<ossim_uint32> bandList;
275  bandList.push_back(band);
276  band_selector->setOutputBandList(bandList);
277  }
278  }
279 
280  // Can only work in 8-bit radiometry:
281  if (chain->getOutputScalarType() != OSSIM_UINT8)
282  {
284  chain->add(remapper.get());
285  remapper->setOutputScalarType(OSSIM_UINT8);
286  }
287 
288  // Finally, add a cache to the input chain:
290  chain->add(cache.get());
291 
292  // Check for specified GSD in config parameters (experimental):
293  double viewGsd = config.getParameter("viewGSD").asFloat();
294 
295  // Set up a common view geometry, even if derived class works exclusively in image space.
296  ossimRefPtr<ossimImageGeometry> image_geom = handler->getImageGeometry();
297  if (!m_viewGeom)
298  {
299  ossimDpt gsd;
300  if (!ossim::isnan(viewGsd) && (viewGsd != 0.0))
301  gsd = ossimDpt(viewGsd, viewGsd);
302  else
303  {
304  gsd = image_geom->getMetersPerPixel();
305  if (gsd.x > gsd.y)
306  gsd.y = gsd.x;
307  else
308  gsd.x = gsd.y;
309  }
310  ossimGpt proj_origin;
311  image_geom->getTiePoint(proj_origin, false);
313  proj->setOrigin(proj_origin);
314  proj->setMetersPerPixel(gsd);
315  proj->setUlTiePoints(proj_origin);
316  m_viewGeom = new ossimImageGeometry(NULL, proj);
317  }
318  else
319  {
320  // View geometry was already set up by first image of the pair (REF). Only need to check the
321  // GSD of the CMP image and adjust the view GSD to match if larger:
322  ossimDpt cmpGsd(image_geom->getMetersPerPixel());
323  if (cmpGsd.x > cmpGsd.y)
324  cmpGsd.y = cmpGsd.x;
325  else
326  cmpGsd.x = cmpGsd.y;
328  if (cmpGsd.x > refGsd.x)
329  {
330  refGsd.x = cmpGsd.x;
331  refGsd.y = cmpGsd.y;
333  }
334  }
335 
336  ivt = new ossimImageViewProjectionTransform(image_geom.get(), m_viewGeom.get());
337 
338  if (m_algorithm == CROSSCORR)
339  {
340  // Need to add a renderer since correlations are done in view-space:
341  ossimImageRenderer* renderer = new ossimImageRenderer;
342  chain->add(renderer);
343  renderer->setImageViewTransform(ivt.get());
344 
345  // Set the appropriate resampling filter for ATP. TODO: Need experimentation.
346  ossimString filterType = AtpConfig::instance().getParameter("resamplingMethod").asString();
347  if (filterType.empty())
348  filterType = "bilinear";
349  ossimRefPtr<ossimProperty> p = new ossimStringProperty("filter_type", filterType);
350  renderer->setProperty(p);
351 
352  // Add cache after resampler:
354  chain->add(cache.get());
355 
357  {
358  ossimDpt imagePt(1,1);
359  ossimDpt viewPt, rtIpt;
360  ivt->imageToView(imagePt, viewPt);
361  ivt->viewToImage(viewPt, rtIpt);
362  CINFO<<MODULE<<"\n imagePt: "<<imagePt<<
363  "\n viewPt: "<<viewPt<<"\n rtIpt: "<<rtIpt<<endl;
364  }
365 
366  }
367  return chain;
368 }
369 
372  std::vector<ossimDpt>& validVertices)
373 {
374  validVertices.clear();
375 
376  // Need to establish the valid image vertices for establishing overlap polygon. Compute in
377  // image space then transform the vertices to view space:
378  if (!chain)
379  return false;
380  ossimImageHandler *handler = dynamic_cast<ossimImageHandler *>(chain->getLastSource());
381  if (!handler)
382  return false;
383 
384  // Check if there is already a vertices file alongside the image:
385  if (handler->openValidVertices())
386  {
387  vector<ossimIpt> iverts;
388  handler->getValidImageVertices(iverts);
389  for (const auto &vert : iverts)
390  validVertices.emplace_back(vert);
391  }
392 
393  if (validVertices.empty())
394  {
395  // If the projection is a sensor model, then assume that the four image-space coordinates are
396  // valid image coordinates.
398  if (geom)
399  {
400  if (dynamic_cast<ossimSensorModel*>(geom->getProjection()))
401  {
402  ossimIrect rect (handler->getBoundingRect());
403  validVertices.emplace_back(rect.ul());
404  validVertices.emplace_back(rect.ur());
405  validVertices.emplace_back(rect.lr());
406  validVertices.emplace_back(rect.ll());
407  }
408  }
409 
410  if (validVertices.empty())
411  {
412  ossimFilename verticesFile(handler->createDefaultValidVerticesFilename());
414  ve->setOutputName(verticesFile);
415  ve->setAreaOfInterest(handler->getBoundingRect(0));
416  ve->execute();
417  const vector<ossimIpt> &iverts = ve->getVertices();
418  for (const auto &vert : iverts)
419  validVertices.emplace_back(vert);
420  }
421  }
422 
423  // The image vertices are necessarily in image space coordinates. Need to transform to a common
424  // "view" space before determining the overlap polygon:
425  ossimDpt vpt;
426  for (auto &vertex : validVertices)
427  {
428  ivt->imageToView(vertex, vpt);
429  vertex = vpt;
430  }
431 
432  return true;
433 }
434 
436 {
437  if (tpList.empty())
438  {
439  out<<"\nTiepoint list is empty.\n"<<endl;
440  }
441  else
442  {
443  for (size_t i=0; i<tpList.size(); ++i)
444  {
445  out<<"\ntiepoint["<<i<<"]: "<<tpList[i]<<endl;
446  }
447  }
448 }
449 
451 {
452  const char* MODULE = "AtpGenerator::generateTiePointList() ";
453  initialize();
454 
456  return false;
457 
458  AtpConfig& config = AtpConfig::instance();
459 
460  // Need to search for features in the REF tile first, then consider only those locations
461  // for correlating. The search tiles were previously established in the base class initialization
462  ossimRefPtr<ossimImageData> ref_tile = 0;
463  ossim_uint32 tileId = 0;
464  for (auto &searchTileRect : m_searchTileRects)
465  {
466  ref_tile = m_atpTileSource->getTile(searchTileRect);
467 
468  AtpList &tileATPs = m_atpTileSource->getTiePoints();
469  if (tileATPs.empty() && config.diagnosticLevel(1))
470  {
471  CINFO << "\n" << MODULE << "No TPs found in tile." << endl;
472  ++tileId;
473  continue;
474  }
475 
476  // Add remaining tile ATPs to master ATP list:
477  if (!tileATPs.empty())
478  atpList.insert(atpList.end(), tileATPs.begin(), tileATPs.end());
479 
480  ++tileId;
481  }
482 
483  if (config.diagnosticLevel(1))
484  CINFO<<"\n"<<MODULE<<"Total number of TPs found in pair = "<<atpList.size()<<endl;
485 
486  if (config.diagnosticLevel(3))
487  {
488  m_annotatedRefImage->write();
489  if (config.diagnosticLevel(4))
490  m_annotatedCmpImage->write();
491  }
492  return true;
493 }
494 
496 {
497  const char* MODULE = "AtpGenerator::layoutSearchTiles() ";
498  AtpConfig& config = AtpConfig::instance();
499 
500  m_searchTileRects.clear();
501 
502  // Note this seems to be specific to correlation-based matching, but should be generalized:
503  unsigned int featureSideSize = config.getParameter("corrWindowSize").asUint();
504 
505  // ### Critical value set here such that we can fit at least 1/2 the number of desired TPs:
506  unsigned int numTpsPerTile = config.getParameter("numFeaturesPerTile").asUint();
507  double min_area = numTpsPerTile*featureSideSize*featureSideSize/2.0;
508 
509  // Found issue with last vertex = first vertex. Remove last if so:
510  int lastVertex = intersectPoly.getNumberOfVertices() - 1;
511  if (lastVertex < 2)
512  {
513  CINFO<<MODULE<<"Intersect polygon num vertices is less than 3! This should never happen."<<endl;
514  return;
515  }
516  if (intersectPoly[0] == intersectPoly[lastVertex])
517  {
518  intersectPoly.removeVertex(lastVertex);
519  if (lastVertex < 3)
520  {
521  CWARN<<MODULE<<"Intersect polygon num vertices is less than 3! This should never happen."<<endl;
522  return;
523  }
524  }
525 
526  double intersectArea = fabs(intersectPoly.area());
527  if (intersectArea < min_area)
528  {
529  CINFO<<MODULE<<"Intersect area too small"<<endl;
530  return;
531  }
532 
533  if (config.diagnosticLevel(3) && m_annotatedRefImage)
534  m_annotatedRefImage->annotateOverlap(intersectPoly);
535 
536  // Prepare to layout evenly-spaced search tiles across overlap bounding rect:
537  ossimIrect aoiRect;
538  intersectPoly.getBoundingRect(aoiRect);
539  int side_length = (int) config.getParameter("featureSearchTileSize").asUint();
540  int dx, dy; // tile width and height
541  int aoiWidth = aoiRect.width();
542  int aoiHeight = aoiRect.height();
543 
544  // Determine optimal X and Y-direction space between tiles (actually between corresponding
545  // UL corners)
546  int gridSize = (int) config.getParameter("searchGridSize").asUint();
547  if (gridSize == 0)
548  {
549  // Check for overlap requirement to account for sampling kernel width:
550  int marginSize = (int) config.getParameter("featureSearchTileMargin").asUint();
551 
552  // No gridsize indicates contiguous tiles (full coverage, usually for DEM generation ATPs:
553  dx = side_length-marginSize;
554  dy = side_length-marginSize;
555  }
556  else
557  {
558  for (int nx=gridSize; nx>1; nx--)
559  {
560  dx = (int) floor(aoiWidth/nx);
561  if (dx >= side_length)
562  break;
563  }
564  for (int ny=gridSize; ny>1; ny--)
565  {
566  dy = (int) floor(aoiHeight/ny);
567  if (dy >= side_length)
568  break;
569  }
570  }
571 
572  // Create tile rects now that the intervals are known:
573  for (int y=aoiRect.ul().y; y<=aoiRect.lr().y-side_length; y+=dy)
574  {
575  for (int x=aoiRect.ul().x; x<=aoiRect.lr().x-side_length; x+=dx)
576  {
577  m_searchTileRects.push_back(ossimIrect (x, y, x+side_length-1, y+side_length-1));
578  }
579  }
580 
581  // Keep only those rects that are inside the overlap polygon. The layout was done over the
582  // overlap's bounding rect, so some may spill outside the overlap:
583  vector<ossimIrect>::iterator b = m_searchTileRects.begin();
584  while (b != m_searchTileRects.end())
585  {
586  if(!intersectPoly.isRectWithin(*b))
587  b = m_searchTileRects.erase(b);
588  else
589  b++;
590  }
591 
592  // Don't bother with less than N boxes, just make the entire intersection a search patch:
593  if (gridSize && (m_searchTileRects.size() < 4))
594  {
595  m_searchTileRects.clear();
596  m_searchTileRects.push_back(m_aoiView);
597  }
598 
599  if (config.diagnosticLevel(2))
600  {
601  for (int tileIdx=0; tileIdx<m_searchTileRects.size(); ++tileIdx)
602  CINFO<<MODULE<<"m_searchTileRects["<<tileIdx<<"] = "<<m_searchTileRects[tileIdx]<<endl;
603 
604  if (config.diagnosticLevel(3) && m_annotatedRefImage)
605  m_annotatedRefImage->annotateFeatureSearchTiles(m_searchTileRects);
606  }
607 }
608 
609 
610 }
ossim_uint32 x
JsonParam & getParameter(const char *paramName)
Returns a parameter (might be a null parameter if paramName not found in the configuration.
Definition: JsonConfig.cpp:377
virtual void setProperty(ossimRefPtr< ossimProperty > property)
void getBoundingRect(ossimDrect &rect)
bool getValidVertices(ossimRefPtr< ossimImageChain > chain, ossimRefPtr< ossimImageViewProjectionTransform > &ivt, std::vector< ossimDpt > &validVertices)
Establishes valid image vertices in view space for later computing overlap.
Class ossimVertexExtractor.
virtual void imageToView(const ossimDpt &imagePoint, ossimDpt &viewPoint) const
Workhorse of the object. Converts image-space to view-space.
Base class for all automatic tiepoints.
Definition: AutoTiePoint.h:30
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
ossimIrect m_aoiView
Definition: AtpGenerator.h:125
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
ossim_uint32 y
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...
void setUseGeoidIfNullFlag(bool flag)
const ossimMapProjection * getAsMapProjection() const
This code was derived from https://gist.github.com/mshockwave.
Definition: Barrier.h:8
void getBoundingRect(ossimIrect &bounding_rect) const
Get the bounding rect of (0, 0) to (imageSize.x-1, imageSize.y-1).
std::shared_ptr< ossim::Image > m_cmpImage
Definition: AtpGenerator.h:118
Finds auto-tie-points using the descriptor-based matching algorithm.
double y
Definition: ossimDpt.h:165
ossim_uint32 height() const
Definition: ossimIrect.h:487
std::string getCmpFilename()
virtual void initialize()
Needs to be called after ref and cmp images are set.
double asFloat() const
Definition: JsonConfig.cpp:278
virtual void setOrigin(const ossimGpt &origin)
This will set the utm zone and utm origin base on origin passed in.
unsigned int asUint() const
Definition: JsonConfig.cpp:264
const ossimIpt & ul() const
Definition: ossimIrect.h:274
Finds auto-tie-points using the corss-correlation-based matching algorithm.
std::shared_ptr< ossim::Image > m_refImage
Definition: AtpGenerator.h:117
bool isRectWithin(const ossimIrect &rect) const
METHOD: isRectWithin() Returns true if all the corner points of the given rect fit within...
virtual void viewToImage(const ossimDpt &viewPoint, ossimDpt &imagePoint) const
Other workhorse of the object. Converts view-space to image-space.
std::vector< std::shared_ptr< AutoTiePoint > > AtpList
Definition: AutoTiePoint.h:137
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
ossimRefPtr< ossimImageViewProjectionTransform > m_refIVT
Definition: AtpGenerator.h:122
ossimRefPtr< ossimImageChain > m_refChain
Definition: AtpGenerator.h:120
void removeVertex(int vertex)
METHOD: remove() Removes the vertex from the polygon.
virtual bool generateTiePointList(ossim::TiePointList &tpList)
This is the main workhorse method.
virtual ossimImageSource * getLastSource()
Return the last source which is the one that last receives the getTile request.
void setImageSize(const ossimIpt &size)
virtual bool openValidVertices(const ossimFilename &vertices_file)
Opens the valid image vertices file and sets theValidImageVerticesFile variable.
ossimIpt size() const
Definition: ossimIrect.h:510
void setImageViewTransform(ossimImageViewTransform *transform)
ossimRefPtr< ossimMultiResLevelHistogram > getImageHistogram() const
Fetches the current entry image&#39;s histogram.
virtual void setMetersPerPixel(const ossimDpt &gsd)
virtual ossimScalarType getOutputScalarType() const
This call is passed to the head of the list.
void set_ul(const ossimIpt &pt)
Definition: ossimIrect.h:589
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
void setStretchMode(StretchMode mode, bool rebuildTableFlag=false)
Sets remap mode to mode.
std::string asString() const
Definition: JsonConfig.cpp:285
std::string getRefFilename()
ossimImageHandlerRegistry supports the new state cache.
virtual ossimFilename createDefaultValidVerticesFilename() const
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
virtual void setOutputScalarType(ossimScalarType scalarType)
Sets the output scalar type.
std::string getRefImageID()
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual const ossimFilename & getFilename() const
Returns the filename.
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
virtual double getHeightAboveEllipsoid(const ossimGpt &gpt)
bool asBool() const
Definition: JsonConfig.cpp:257
ossimRefPtr< AtpTileSource > m_atpTileSource
Definition: AtpGenerator.h:119
unsigned int ossim_uint32
ossimDpt getMetersPerPixel() const
Returns the GSD associated with this image in the active projection.
Cache Tile Source.
double height() const
Definition: ossimGpt.h:107
const ossimIpt & lr() const
Definition: ossimIrect.h:276
virtual bool add(ossimConnectableObject *source)
Will return true or false if an image source was added to the chain.
virtual ~AtpGenerator()
ossim_uint32 width() const
Definition: ossimIrect.h:500
THESE FUNCTIONS REQUIRE OPENCV.
bool diagnosticLevel(unsigned int level) const
Convenience method returns TRUE if the currently set diagnostic level is <= level.
Definition: JsonConfig.cpp:461
void getBoundingRect(ossimIrect &rect) const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
ossim_uint32 getNumberOfVertices() const
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
T * getObjectAs(ossim_uint32 idx=0)
Definition: ossimVisitor.h:64
void set_lr(const ossimIpt &pt)
Definition: ossimIrect.h:623
void getTiePoint(ossimGpt &tie, bool edge) const
Get the latitude, longitude of the tie point.
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
virtual void getValidImageVertices(vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
ordering specifies how the vertices should be arranged.
ossim_int32 y
Definition: ossimIpt.h:142
static std::shared_ptr< AutoTiePoint > s_referenceATP
Definition: AtpGenerator.h:129
void setDefaultHeightAboveEllipsoid(double meters)
double area() const
Returns polygon area. Negative indicates CW ordering of vertices (in right-handed coordinates) ...
virtual void setOutputBandList(const vector< ossim_uint32 > &outputBandList, bool disablePassThru=false)
Sets the output band list.
double x
Definition: ossimDpt.h:164
#define CFATAL
bool empty() const
Definition: ossimString.h:411
ossimImageHandler * getImageHandler(ossimRefPtr< ossimImageChain > &chain)
static AtpConfig & instance()
Singleton implementation.
Definition: AtpConfig.cpp:20
void setImageID(const ossimString &id)
Sets the image ID in case it is externally generated.
virtual void setUlTiePoints(const ossimGpt &gpt)
static ossimImageHandlerRegistry * instance()
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
ossim_int32 x
Definition: ossimIpt.h:141
8 bit unsigned integer
#define CWARN
Algorithm m_algorithm
Definition: AtpGenerator.h:116
For engineering use in ATP.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
void setHistogram(ossimRefPtr< ossimMultiResLevelHistogram > histogram)
Sets the histogram.
#define CINFO
std::string getCmpImageID()
bool getVisiblePolygons(vector< ossimPolygon > &polyList) const
void setRefImage(std::shared_ptr< ossim::Image > ref_image)
const ossimString & getImageID() const
Fetches the image ID.
std::vector< ossimIrect > m_searchTileRects
Definition: AtpGenerator.h:128
ossimRefPtr< ossimImageViewProjectionTransform > m_cmpIVT
Definition: AtpGenerator.h:123
void getCenter(ossimDpt &center_point) const
Definition: ossimIrect.cpp:672
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
void setCmpImage(std::shared_ptr< ossim::Image > cmp_image)
Singleton class maintaining parameters affecting the automatic tie point generation.
Definition: AtpConfig.h:24
static void writeTiePointList(ostream &out, const AtpList &tpList)
For engineering use.
const std::string & string() const
Definition: ossimString.h:414
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91
virtual bool buildHistogram(int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
Build a histogram for image file.