Loading [MathJax]/jax/output/NativeMML/config.js
 |
Isis 3 Programmer Reference
|
14 #include <QSharedPointer>
17 #include "Projection.h"
18 #include "SpecialPixel.h"
19 #include "SmtkMatcher.h"
26 m_offImage(0), m_spiceErr(0),
44 Cube *rhCube) : m_lhCube(lhCube),
46 m_gruen(0), m_offImage(0),
134 m_gruen->WriteSubsearchChips(fileptrn);
150 SmtkQStackIter best(stack.begin()), current(stack.begin());
151 while ( current != stack.end() ) {
152 if (current.value().GoodnessOfFit() < best.value().GoodnessOfFit() ) {
183 const double &seedsample,
185 const double &maxEV) {
187 if (stack.isEmpty())
return (stack.end());
188 SmtkQStackIter best(stack.begin()), current(stack.begin());
191 double randNum = gsl_rng_uniform (r);
192 double t1 = -std::log(1.0 - randNum *
193 (1.0 - std::exp(-seedsample)))/seedsample;
194 double pt = minEV + t1*(maxEV-minEV);
195 double best_ev(DBL_MAX);
196 while ( current != stack.end() ) {
197 double test_ev(std::fabs(current.value().GoodnessOfFit()-pt));
198 if ( test_ev < best_ev) {
224 std::cout <<
"Point status is invalid!\n";
230 std::cout <<
"Left point (" << spnt.
getLeft().getLine() <<
","
231 << spnt.
getLeft().getSample() <<
") is invalid!\n";
237 std::cout <<
"Right point (" << spnt.
getRight().getLine() <<
","
238 << spnt.
getRight().getSample() <<
") is invalid!\n";
303 return (
Register(left, right, affrad));
342 if (!lpg.getPoint().
isValid()) {
343 QString mess =
"Left point is not defined which is required";
357 if (!left.isValid()) {
380 if (!right.isValid()) {
387 m_gruen->PatternChip()->TackCube(lpnt.getSample(), lpnt.getLine());
388 m_gruen->PatternChip()->Load(*m_lhCube);
389 m_gruen->SearchChip()->TackCube(rpnt.getSample(), rpnt.getLine());
390 m_gruen->SearchChip()->Load(*m_rhCube, *m_gruen->PatternChip(),
399 m_gruen->setAffineRadio(affrad);
447 spnt.m_isValid =
true;
478 mpt.m_point = cpoint;
482 spnt.m_registered =
false;
483 spnt.m_isValid =
inCube(lhCamera(), left) &&
inCube(rhCamera(), right);
500 r = gsl_rng_alloc (T);
519 if (!m_lhCube) isGood =
false;
520 if (!m_rhCube) isGood =
false;
521 if (!m_gruen.data()) isGood =
false;
522 if ((!isGood) && throwError) {
523 QString mess =
"Images/match algorithm not initialized!";
541 if (!pnt.
isValid())
return (
false);
542 if ( (pnt.getSample() < 0.5) || (pnt.getLine() < 0.5) )
return false;
543 if ( (pnt.getSample() > (camera.
Samples() + 0.5)) ||
544 (pnt.getLine() > (camera.
Lines() + 0.5)) ) {
566 if (
inCube(camera, pnt)) {
567 if ( camera.
SetImage(pnt.getSample(), pnt.getLine()) ) {
626 PointPair(left.getGeometry(), right.getGeometry())));
644 if ( !rpoint.isValid() ) {
646 spnt.m_isValid =
false;
650 double dist = (rcorr - right.getPoint()).getDistance();
653 spnt.m_isValid =
false;
656 spnt.m_isValid = match.isValid();
bool isRegistered() const
Returns registration status.
Coordinate getPoint(const Coordinate &location) const
Applies the affine transfrom to a point and returns result.
SmtkQStackIter FindSmallestEV(SmtkQStack &stack)
Find the smallest eigen value on the given stack.
void setGruenDef(const QString ®def)
Initialize Gruen algorithm with definitions in Pvl file provided.
SmtkPoint makeRegisteredPoint(const PointGeometry &left, const PointGeometry &right, Gruen *gruen)
Create an SmtkPoint from Gruen match result.
Container for SMTK match points.
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
void setLatLon(const double &latitude, const double &longitude)
Use Latitude/Longitude interface.
virtual double Sample() const
Returns the current sample number.
Coordinate getLatLon(Camera &camera, const Coordinate &pnt)
Compute latitude, longitude from line,sample.
Container for affine and radiometric parameters.
AutoReg::RegisterStatus Register()
Walk the pattern chip through the search chip to find the best registration.
Container for cube-like labels.
void randomNumberSetup()
Initialize the random number generator.
Define a generic Y/X container.
const Coordinate & getRight() const
Returns the registered right coordinate.
static GSLUtility * getInstance()
Return a reference to the GSL (singleton) object.
MatchPoint getLastMatch() const
Returns the register state of the last successful Gruen match.
SmtkPoint Clone(const SmtkPoint &point, const Coordinate &left)
Clone a point set from a nearby (left image) point and Gruen affine.
SmtkQStackIter FindExpDistEV(SmtkQStack &stack, const double &seedsample, const double &minEV, const double &maxEV)
Find the best eigen value using exponential distribution formula.
bool validate(const bool &throwError=true) const
Validates the state of the Camera and Gruen algoritm.
void setImages(Cube *lhImage, Cube *rhImage)
Assign cubes for matching.
SmtkMatcher()
Construct default matcher.
double getSpiceConstraint() const
Returns the SPICE tolerance constraint as read from config file.
@ SuccessSubPixel
Success registering to sub-pixel accuracy.
bool InCube()
This returns true if the current Sample() or Line() value is outside of the cube (meaning the point m...
This is free and unencumbered software released into the public domain.
void setWriteSubsearchChipPattern(const QString &fileptrn="SmtkMatcher")
Set file pattern for output subsearch chips.
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
const AffineRadio & getAffine() const
Returns the affine transform and radiometic results.
double CubeSample() const
Return the search chip cube sample that best matched.
Define a point set of left, right and geometry at that location.
virtual bool SetUniversalGround(const double latitude, const double longitude)
Sets the lat/lon values to get the sample/line values.
~SmtkMatcher()
Free random number generator in destructor.
Coordinate getLineSample(Camera &camera, const Coordinate &geom)
Compute line,sample from latitude, longitude.
IO Handler for Isis Cubes.
bool isValid(const Coordinate &pnt)
Determine if a point is valid in both left/right images.
bool isValid() const
Check for goodness.
Structure containing comprehensive registration info/results.
int Samples() const
Returns the number of samples in the image.
bool inCube(const Camera &camera, const Coordinate &point) const
Determines if the line/sample is within physical cube boundaries.
@ Programmer
This error is for when a programmer made an API call that was illegal.
Container for a point and its geometry.
void setZeroState()
Resets eigenvalues to 0.
double CubeLine() const
Return the search chip cube line that best matched.
int Lines() const
Returns the number of lines in the image.
SmtkPoint Create(const Coordinate &left, const Coordinate &right)
Create a valid, unregistered SmtkPoint.
Gruen pattern matching algorithm.
virtual double Line() const
Returns the current line number.
const Coordinate & getLeft() const
Returns the left point.
void setLineSamp(const double &line, const double &sample)
Use the Line/Sample interface.
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...
This is free and unencumbered software released into the public domain.
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
bool isValid() const
Indicates the smtk portion of the point is valid.