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
23namespace Isis {
24
46 public:
48 SmtkMatcher(const QString &regdef);
49 SmtkMatcher(const QString &regdef, Cube *lhImage, Cube *rhImage);
50 SmtkMatcher(Cube *lhImage, Cube *rhImage);
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
Container for affine and radiometric parameters.
Definition GruenTypes.h:242
Definition Camera.h:236
A small chip of data used for pattern matching.
Definition Chip.h:86
Define a generic Y/X container.
Definition GruenTypes.h:53
IO Handler for Isis Cubes.
Definition Cube.h:168
Camera * camera()
Return a camera associated with the cube.
Definition Cube.cpp:1457
Container for a point and its geometry.
Definition SmtkPoint.h:24
Define a point set of left, right and geometry at that location.
Definition GruenTypes.h:171
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:119
Workhorse of stereo matcher.
Definition SmtkMatcher.h:45
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
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
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
SmtkMatcher(Cube *lhImage, Cube *rhImage)
Chip * SearchChip() const
Return search chip.
Definition SmtkMatcher.h:66
void setImages(Cube *lhImage, Cube *rhImage)
Assign cubes for matching.
Definition SmtkMatcher.cpp:60
Chip * PatternChip() const
Return pattern chip.
Definition SmtkMatcher.h:60
bool isValid(const Coordinate &pnt)
Determine if a point is valid in both left/right images.
Definition SmtkMatcher.cpp:101
void setGruenDef(const QString &regdef)
Initialize Gruen algorithm with definitions in Pvl file provided.
Definition SmtkMatcher.cpp:78
PvlGroup RegTemplate()
Return Gruen template parameters.
Definition SmtkMatcher.h:99
BigInt OffImageErrorCount() const
Definition SmtkMatcher.h:95
Chip * FitChip() const
Returns the fit chip.
Definition SmtkMatcher.h:72
Pvl RegistrationStatistics()
Return Gruen registration statistics.
Definition SmtkMatcher.h:101
BigInt SpiceErrorCount() const
Definition SmtkMatcher.h:96
~SmtkMatcher()
Free random number generator in destructor.
Definition SmtkMatcher.cpp:54
SmtkQStackIter FindSmallestEV(SmtkQStack &stack)
Find the smallest eigen value on the given stack.
Definition SmtkMatcher.cpp:149
void setWriteSubsearchChipPattern(const QString &fileptrn="SmtkMatcher")
Set file pattern for output subsearch chips.
Definition SmtkMatcher.cpp:132
SmtkMatcher()
Construct default matcher.
Definition SmtkMatcher.cpp:25
SmtkPoint Create(const Coordinate &left, const Coordinate &right)
Create a valid, unregistered SmtkPoint.
Definition SmtkMatcher.cpp:427
Container for SMTK match points.
Definition SmtkPoint.h:54
This is free and unencumbered software released into the public domain.
Definition ControlNet.h:32
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
SmtkQStack::iterator SmtkQStackIter
Definition SmtkStack.h:19
long long int BigInt
Big int.
Definition Constants.h:49