File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis Developer Reference
SmtkMatcher.h
Go to the documentation of this file.
1 #ifndef SmtkMatcher_h
2 #define SmtkMatcher_h
3 
9 /* SPDX-License-Identifier: CC0-1.0 */
10 
11 #include <memory>
12 
13 
14 #include <QSharedPointer>
15 #include "SmtkStack.h"
16 #include "Gruen.h"
17 #include "SmtkPoint.h"
18 
19 #include "GSLUtility.h"
20 #include <gsl/gsl_rng.h>
21 
22 
23 namespace Isis {
24 
45 class SmtkMatcher {
46  public:
47  SmtkMatcher();
48  SmtkMatcher(const QString &regdef);
49  SmtkMatcher(const QString &regdef, Cube *lhImage, Cube *rhImage);
50  SmtkMatcher(Cube *lhImage, Cube *rhImage);
51  ~SmtkMatcher();
52 
53  void setImages(Cube *lhImage, Cube *rhImage);
54  void setGruenDef(const QString &regdef);
55 
56  bool isValid(const Coordinate &pnt);
57  bool isValid(const SmtkPoint &spnt);
58 
60  Chip *PatternChip() const {
61  validate();
62  return (m_gruen->PatternChip());
63  }
64 
66  Chip *SearchChip() const {
67  validate();
68  return (m_gruen->SearchChip());
69  }
70 
72  Chip *FitChip() const {
73  validate();
74  return (m_gruen->FitChip());
75  }
76 
77  void setWriteSubsearchChipPattern(const QString &fileptrn = "SmtkMatcher");
78 
80  SmtkQStackIter FindExpDistEV(SmtkQStack &stack, const double &seedsample,
81  const double &minEV, const double &maxEV);
82 
83  SmtkPoint Register(const Coordinate &lpnt,
84  const AffineRadio &affrad = AffineRadio());
85  SmtkPoint Register(const PointPair &pnts,
86  const AffineRadio &affrad = AffineRadio());
87  SmtkPoint Register(const SmtkPoint &spnt,
88  const AffineRadio &affrad = AffineRadio());
89  SmtkPoint Register(const PointGeometry &lpg, const PointGeometry &rpg,
90  const AffineRadio &affrad = AffineRadio());
91 
92  SmtkPoint Create(const Coordinate &left, const Coordinate &right);
93  SmtkPoint Clone(const SmtkPoint &point, const Coordinate &left);
94 
95  inline BigInt OffImageErrorCount() const { return (m_offImage); }
96  inline BigInt SpiceErrorCount() const { return (m_spiceErr); }
97 
99  PvlGroup RegTemplate() { return (m_gruen->RegTemplate()); }
101  Pvl RegistrationStatistics() { return (m_gruen->RegistrationStatistics()); }
102 
103  private:
104  SmtkMatcher &operator=(const SmtkMatcher &matcher); // Assignment disabled
105  SmtkMatcher(const SmtkMatcher &matcher); // Copy const disabled
106 
107  Cube *m_lhCube; // Left image cube (not owned)
108  Cube *m_rhCube; // Right image cube (not owned)
109  QSharedPointer<Gruen> m_gruen; // Gruen matcher
110  BigInt m_offImage; // Offimage counter
111  BigInt m_spiceErr; // SPICE distance error
112  bool m_useAutoReg; // Select AutoReg features
113  const gsl_rng_type * T; // GSL random number type
114  gsl_rng * r; // GSL random number generator
115 
116  void randomNumberSetup();
117  bool validate(const bool &throwError = true) const;
118 
119  inline Camera &lhCamera() { return (*m_lhCube->camera()); }
120  inline Camera &rhCamera() { return (*m_rhCube->camera()); }
121 
122  Coordinate getLineSample(Camera &camera, const Coordinate &geom);
123  Coordinate getLatLon(Camera &camera, const Coordinate &pnt);
124 
125  bool inCube(const Camera &camera, const Coordinate &point) const;
126 
127  SmtkPoint makeRegisteredPoint(const PointGeometry &left,
128  const PointGeometry &right, Gruen *gruen);
129 };
130 } // namespace Isis
131 
132 #endif
Isis::SmtkPoint::isRegistered
bool isRegistered() const
Returns registration status.
Definition: SmtkPoint.h:133
Isis::AffineRadio::getPoint
Coordinate getPoint(const Coordinate &location) const
Applies the affine transfrom to a point and returns result.
Definition: GruenTypes.h:272
Isis::PointGeometry::isValid
bool isValid() const
Definition: SmtkPoint.h:32
Isis::SmtkMatcher::FindSmallestEV
SmtkQStackIter FindSmallestEV(SmtkQStack &stack)
Find the smallest eigen value on the given stack.
Definition: SmtkMatcher.cpp:149
SmtkPoint.h
Isis::SmtkMatcher::setGruenDef
void setGruenDef(const QString &regdef)
Initialize Gruen algorithm with definitions in Pvl file provided.
Definition: SmtkMatcher.cpp:78
Isis::SmtkPoint
Container for SMTK match points.
Definition: SmtkPoint.h:54
SpecialPixel.h
Isis::MatchPoint::m_point
PointPair m_point
Definition: GruenTypes.h:457
Isis::SmtkMatcher::PatternChip
Chip * PatternChip() const
Return pattern chip.
Definition: SmtkMatcher.h:60
Isis::SmtkPoint::m_registered
bool m_registered
Definition: SmtkPoint.h:138
Isis::AffineRadio
Container for affine and radiometric parameters.
Definition: GruenTypes.h:242
Isis::SmtkPoint::m_matchpt
MatchPoint m_matchpt
Definition: SmtkPoint.h:135
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::SmtkMatcher::SpiceErrorCount
BigInt SpiceErrorCount() const
Definition: SmtkMatcher.h:96
QSharedPointer
Definition: JigsawWorkOrder.h:28
Isis::Camera
Definition: Camera.h:236
SmtkStack.h
Isis::Coordinate::getSample
double getSample() const
Definition: GruenTypes.h:114
Isis::Coordinate
Define a generic Y/X container.
Definition: GruenTypes.h:53
Isis::SmtkPoint::m_isValid
bool m_isValid
Definition: SmtkPoint.h:139
SmtkMatcher.h
Isis::SmtkPoint::getRight
const Coordinate & getRight() const
Returns the registered right coordinate.
Definition: SmtkPoint.h:112
Isis::SmtkMatcher::RegistrationStatistics
Pvl RegistrationStatistics()
Return Gruen registration statistics.
Definition: SmtkMatcher.h:101
Isis::GSL::GSLUtility::getInstance
static GSLUtility * getInstance()
Return a reference to the GSL (singleton) object.
Definition: GSLUtility.cpp:49
GSLUtility.h
Isis::PointGeometry::getPoint
const Coordinate & getPoint() const
Definition: SmtkPoint.h:36
Isis::SmtkMatcher::Clone
SmtkPoint Clone(const SmtkPoint &point, const Coordinate &left)
Clone a point set from a nearby (left image) point and Gruen affine.
Definition: SmtkMatcher.cpp:467
Gruen.h
Isis::SmtkMatcher::FindExpDistEV
SmtkQStackIter FindExpDistEV(SmtkQStack &stack, const double &seedsample, const double &minEV, const double &maxEV)
Find the best eigen value using exponential distribution formula.
Definition: SmtkMatcher.cpp:182
Isis::SmtkMatcher::setImages
void setImages(Cube *lhImage, Cube *rhImage)
Assign cubes for matching.
Definition: SmtkMatcher.cpp:60
Isis::SmtkMatcher::SmtkMatcher
SmtkMatcher()
Construct default matcher.
Definition: SmtkMatcher.cpp:25
Isis::AutoReg::SuccessSubPixel
@ SuccessSubPixel
Success registering to sub-pixel accuracy.
Definition: AutoReg.h:181
QHash
This is free and unencumbered software released into the public domain.
Definition: ControlNet.h:32
Isis::SmtkMatcher::setWriteSubsearchChipPattern
void setWriteSubsearchChipPattern(const QString &fileptrn="SmtkMatcher")
Set file pattern for output subsearch chips.
Definition: SmtkMatcher.cpp:132
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::SmtkPoint::getAffine
const AffineRadio & getAffine() const
Returns the affine transform and radiometic results.
Definition: SmtkPoint.h:117
Isis::PointPair
Define a point set of left, right and geometry at that location.
Definition: GruenTypes.h:171
Isis::SmtkMatcher::RegTemplate
PvlGroup RegTemplate()
Return Gruen template parameters.
Definition: SmtkMatcher.h:99
Isis::PointGeometry::getGeometry
const Coordinate & getGeometry() const
Definition: SmtkPoint.h:37
Isis::BigInt
long long int BigInt
Big int.
Definition: Constants.h:49
Isis::SmtkMatcher::~SmtkMatcher
~SmtkMatcher()
Free random number generator in destructor.
Definition: SmtkMatcher.cpp:54
Isis::Coordinate::getLine
double getLine() const
Definition: GruenTypes.h:113
Isis::MatchPoint::m_analysis
Analysis m_analysis
Definition: GruenTypes.h:459
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::SmtkMatcher::isValid
bool isValid(const Coordinate &pnt)
Determine if a point is valid in both left/right images.
Definition: SmtkMatcher.cpp:101
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Coordinate::isValid
bool isValid() const
Check for goodness.
Definition: GruenTypes.h:107
Isis::MatchPoint
Structure containing comprehensive registration info/results.
Definition: GruenTypes.h:433
Isis::SmtkMatcher::OffImageErrorCount
BigInt OffImageErrorCount() const
Definition: SmtkMatcher.h:95
Camera.h
Isis::Cube::camera
Camera * camera()
Return a camera associated with the cube.
Definition: Cube.cpp:1451
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::SmtkQStackIter
SmtkQStack::iterator SmtkQStackIter
Definition: SmtkStack.h:19
Isis::PointPair::getLeft
const Coordinate & getLeft() const
Definition: GruenTypes.h:184
Isis::Chip
A small chip of data used for pattern matching.
Definition: Chip.h:86
Isis::PointGeometry
Container for a point and its geometry.
Definition: SmtkPoint.h:24
Projection.h
Isis::Analysis::setZeroState
void setZeroState()
Resets eigenvalues to 0.
Definition: GruenTypes.h:403
Isis::SmtkMatcher::Create
SmtkPoint Create(const Coordinate &left, const Coordinate &right)
Create a valid, unregistered SmtkPoint.
Definition: SmtkMatcher.cpp:427
Isis::SmtkMatcher
Workhorse of stereo matcher.
Definition: SmtkMatcher.h:45
Isis::Gruen
Gruen pattern matching algorithm.
Definition: Gruen.h:74
Isis::PointPair::getRight
const Coordinate & getRight() const
Definition: GruenTypes.h:185
Isis::SmtkPoint::getLeft
const Coordinate & getLeft() const
Returns the left point.
Definition: SmtkPoint.h:98
Isis::SmtkMatcher::FitChip
Chip * FitChip() const
Returns the fit chip.
Definition: SmtkMatcher.h:72
Isis::SmtkMatcher::SmtkMatcher
SmtkMatcher(Cube *lhImage, Cube *rhImage)
Isis::SmtkMatcher::Register
SmtkPoint Register(const Coordinate &lpnt, const AffineRadio &affrad=AffineRadio())
This method takes a sample, line from the left-hand image and tries to find the matching point in the...
Definition: SmtkMatcher.cpp:250
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::SmtkMatcher::SearchChip
Chip * SearchChip() const
Return search chip.
Definition: SmtkMatcher.h:66
Isis::SmtkPoint::isValid
bool isValid() const
Indicates the smtk portion of the point is valid.
Definition: SmtkPoint.h:70

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:12:35