Isis 3 Programmer Reference
Isis::AdaptiveGruen Class Reference

Gruen (adaptive) pattern matching. More...

#include <AdaptiveGruen.h>

Inheritance diagram for Isis::AdaptiveGruen:
Inheritance graph
Collaboration diagram for Isis::AdaptiveGruen:
Collaboration graph

Public Types

enum  RegisterStatus {
  SuccessPixel, SuccessSubPixel, PatternChipNotEnoughValidData, FitChipNoData,
  FitChipToleranceNotMet, SurfaceModelNotEnoughValidData, SurfaceModelSolutionInvalid, SurfaceModelDistanceInvalid,
  PatternZScoreNotMet, AdaptiveAlgorithmFailed
}
 Enumeration of the Register() method's return status. More...
 
enum  GradientFilterType { None, Sobel }
 Enumeration of the different types of gradient filters that can be applied to the pattern and search chips before matching them. More...
 

Public Member Functions

 AdaptiveGruen (Pvl &pvl)
 Construct a AdaptiveGruen search algorithm. More...
 
virtual ~AdaptiveGruen ()
 Destructor for AdaptiveGruen. More...
 
virtual bool IsAdaptive ()
 AdaptiveGruen is adaptive. More...
 
BigInt CallCount () const
 Returns the current call count. More...
 
void WriteSubsearchChips (const QString &pattern="SubChip")
 Set up for writing subsearch for a a given registration call. More...
 
AffineTolerance getAffineTolerance () const
 Return set of tolerances for affine convergence. More...
 
double getSpiceConstraint () const
 Returns the SPICE tolerance constraint as read from config file. More...
 
double getAffineConstraint () const
 Returns the Affine tolerance constraint as read from config file. More...
 
void setAffineRadio (const AffineRadio &affrad)
 Sets initial chip transformation. More...
 
void setAffineRadio ()
 Set affine parameters to defaults. More...
 
const AffineRadiogetDefaultAffineRadio () const
 Returns default settings for Affine/Radiometric parameters. More...
 
const AffineRadiogetAffineRadio () const
 Return current state of Affine/Radio state. More...
 
MatchPoint getLastMatch () const
 Returns the register state of the last successful Gruen match. More...
 
ChipPatternChip ()
 Return pointer to pattern chip. More...
 
ChipSearchChip ()
 Return pointer to search chip. More...
 
ChipFitChip ()
 Return pointer to fit chip. More...
 
ChipRegistrationPatternChip ()
 Return pointer to pattern chip used in registration. More...
 
ChipRegistrationSearchChip ()
 Return pointer to search chip used in registration. More...
 
ChipReducedPatternChip ()
 Return pointer to reduced pattern chip. More...
 
ChipReducedSearchChip ()
 Return pointer to reduced search chip. More...
 
ChipReducedFitChip ()
 Return pointer to reduced fit chip. More...
 
void SetSubPixelAccuracy (bool on)
 If the sub-pixel accuracy is enabled, the Register() method will attempt to match the pattern chip to the search chip at sub-pixel accuracy, otherwise it will be registered at whole pixel accuracy. More...
 
void SetPatternValidPercent (const double percent)
 Set the amount of data in the pattern chip that must be valid. More...
 
void SetSubsearchValidPercent (const double percent)
 Set the amount of data in the search chip's subchip that must be valid. More...
 
void SetTolerance (double tolerance)
 Set the tolerance for an acceptable goodness of fit. More...
 
void SetChipInterpolator (const QString &interpolator)
 Sets the Chip class interpolator type to be used to load pattern and search chips. More...
 
void SetSurfaceModelWindowSize (int size)
 Set the surface model window size. More...
 
void SetSurfaceModelDistanceTolerance (double distance)
 Set a distance the surface model solution is allowed to move away from the best whole pixel fit in the fit chip. More...
 
void SetReductionFactor (int reductionFactor)
 Set the reduction factor used to speed up the pattern matching algorithm. More...
 
void SetPatternZScoreMinimum (double minimum)
 Set the minimum pattern zscore. More...
 
void SetGradientFilterType (const QString &gradientFilterType)
 Set the gradient filter type to be applied to the search and pattern chips. More...
 
QString GradientFilterString () const
 
bool SubPixelAccuracy ()
 Return whether this object will attempt to register to whole or sub-pixel accuracy. More...
 
int ReductionFactor ()
 Return the reduction factor. More...
 
double PatternValidPercent () const
 Return pattern chip valid percent. The default value is. More...
 
double SubsearchValidPercent () const
 Return subsearch chip valid percent. More...
 
double Tolerance () const
 Return match algorithm tolerance. More...
 
double WindowSize () const
 Return window size. More...
 
double DistanceTolerance () const
 Return distance tolerance. More...
 
void Distance (double &sampDistance, double &lineDistance)
 Return the distance point moved. More...
 
AutoReg::RegisterStatus Register ()
 Walk the pattern chip through the search chip to find the best registration. More...
 
bool Success () const
 Return whether the match algorithm succeeded or not. More...
 
double GoodnessOfFit () const
 Return the goodness of fit of the match algorithm. More...
 
bool IsIdeal (double fit)
 Returns true if the fit parameter is arbitrarily close to the ideal fit value. More...
 
double ChipSample () const
 Return the search chip sample that best matched. More...
 
double ChipLine () const
 Return the search chip line that best matched. More...
 
double CubeSample () const
 Return the search chip cube sample that best matched. More...
 
double CubeLine () const
 Return the search chip cube line that best matched. More...
 
double MinimumZScore () const
 Return minimumPatternZScore. More...
 
void ZScores (double &score1, double &score2) const
 Return the ZScores of the pattern chip. More...
 
Pvl RegistrationStatistics ()
 This returns the cumulative registration statistics. More...
 
virtual double MostLenientTolerance ()
 Minimum tolerance specific to algorithm. More...
 
PvlGroup RegTemplate ()
 This function returns the keywords that this object was created from. More...
 
PvlGroup UpdatedTemplate ()
 Returns a PvlGroup containing the PvlKeywords of the parameters this object was most recently run with. More...
 

Protected Member Functions

virtual QString AlgorithmName () const
 Return name of Algorithm. More...
 
int algorithm (Chip &pattern, Chip &subsearch, const Radiometric &radio, BigInt &ptsUsed, double &resid, GMatrix &atai, AffineRadio &affrad)
 Real workhorse of the computational Gruen algorithm. More...
 
Analysis errorAnalysis (const BigInt &npts, const double &resid, const GMatrix &atai)
 Compute the error analysis of convergent Gruen matrix. More...
 
virtual double MatchAlgorithm (Chip &pattern, Chip &subsearch)
 Minimization of data set using Gruen algorithm. More...
 
virtual bool CompareFits (double fit1, double fit2)
 This virtual method must return if the 1st fit is equal to or better than the second fit. More...
 
virtual double IdealFit () const
 Returns the ideal fit for a perfect Gruen result. More...
 
virtual AutoReg::RegisterStatus Registration (Chip &sChip, Chip &pChip, Chip &fChip, int startSamp, int startLine, int endSamp, int endLine, int bestSamp, int bestLine)
 Applies the adaptive Gruen algorithm to pattern and search chips. More...
 
virtual Pvl AlgorithmStatistics (Pvl &pvl)
 Create Gruen error and processing statistics Pvl output. More...
 
void SetChipSample (double sample)
 Sets the search chip subpixel sample that matches the pattern tack sample. More...
 
void SetChipLine (double line)
 Sets the search chip subpixel line that matches the pattern tack line. More...
 
void SetGoodnessOfFit (double fit)
 Sets the goodness of fit for adaptive algorithms. More...
 
void Parse (Pvl &pvl)
 Initialize parameters in the AutoReg class using a PVL specification. More...
 
bool SetSubpixelPosition (Chip &window)
 Set the search chip sample and line to subpixel values if possible. More...
 
Chip Reduce (Chip &chip, int reductionFactor)
 This method reduces the given chip by the given reduction factor. More...
 

Protected Attributes

PvlObject p_template
 AutoRegistration object that created this projection. More...
 

Detailed Description

Gruen (adaptive) pattern matching.

The AdaptiveGruen pattern/search chip registration algorithm is derived from the Gruen class. It is adaptive in that it uses an Affine transform to load the subsearch chip from the search chip. The Affine transform is iteratively minimized to converge on an cummulative affine solution that best matches the pattern chip.

See also
Gruen AutoReg MinimumGruen
Author
2009-09-09 Kris Becker
History:
2017-06-28 Makayla Shepherd - Updated documentation. References #4807.

Definition at line 51 of file AdaptiveGruen.h.

Member Enumeration Documentation

◆ GradientFilterType

Enumeration of the different types of gradient filters that can be applied to the pattern and search chips before matching them.

Enumerator
None 

default, no gradient filter

Sobel 

Sobel gradient filter.

Definition at line 212 of file AutoReg.h.

◆ RegisterStatus

Enumeration of the Register() method's return status.

All of the enumerations describe a failure to register except "Success". These status values can be used to provide the user with more specific feedback on why registration did not succeed.

Enumerator
SuccessPixel 

Success registering to whole pixel.

SuccessSubPixel 

Success registering to sub-pixel accuracy.

PatternChipNotEnoughValidData 

Not enough valid data in pattern chip.

FitChipNoData 

Fit chip did not have any valid data.

FitChipToleranceNotMet 

Goodness of fit tolerance not satisfied.

SurfaceModelNotEnoughValidData 

Not enough points to fit a surface model for sub-pixel accuracy.

SurfaceModelSolutionInvalid 

Could not model surface for sub-pixel accuracy.

SurfaceModelDistanceInvalid 

Surface model moves registration more than one pixel.

PatternZScoreNotMet 

Pattern data max or min does not pass the z-score test.

AdaptiveAlgorithmFailed 

Error occured in Adaptive algorithm.

Definition at line 195 of file AutoReg.h.

Constructor & Destructor Documentation

◆ AdaptiveGruen()

Isis::AdaptiveGruen::AdaptiveGruen ( Pvl pvl)
inline

Construct a AdaptiveGruen search algorithm.

This will construct an AdaptiveGruen search algorithm. It is recommended that you use a AutoRegFactory class as opposed to this constructor

Parameters
pvlA Pvl object that contains a valid automatic registration definition

Definition at line 63 of file AdaptiveGruen.h.

◆ ~AdaptiveGruen()

virtual Isis::AdaptiveGruen::~AdaptiveGruen ( )
inlinevirtual

Destructor for AdaptiveGruen.

Definition at line 66 of file AdaptiveGruen.h.

Member Function Documentation

◆ algorithm()

int Isis::Gruen::algorithm ( Chip pattern,
Chip subsearch,
const Radiometric radio,
BigInt ptsUsed,
double &  resid,
GMatrix &  atai,
AffineRadio affrad 
)
protectedinherited

Real workhorse of the computational Gruen algorithm.

This method is called for all registration requests and actually performs the registration of two chips.

The pattern chip is deemed constant. The subsearch chip is generally an extraction from the search chip that has had an affine transform applied to fill it.

At each iteration of the Gruen algorithm, the affine transform is incrementally updated based upon the results from this method. There are six affine parameters and two radiometric (shift and gain) parameters that are solved/computed here.

The algorithm itself is a first derivative computation of the subsearch chip with small radiometric adjustments applied to better tone match the two chips. This is intended to minimize the affine variability.

Parameters
patternFixed pattern chip which subsearch is trying to match
subsearchAffined extraction of the search chip
Returns
Returns 0 if successful, otherwise returns the error number associated with the problem encountered (see ErrorTypes)

Definition at line 172 of file Gruen.cpp.

References Isis::Gruen::Choldc(), Isis::Gruen::Cholsl(), Isis::Chip::GetValue(), Isis::Chip::IsValid(), Isis::Chip::Lines(), Isis::Gruen::logError(), Isis::Gruen::MinValidPoints(), Isis::Chip::Samples(), Isis::Chip::TackLine(), Isis::Chip::TackSample(), Isis::IException::toString(), and Isis::Gruen::ValidPoints().

Referenced by Isis::Gruen::MatchAlgorithm(), and Isis::Gruen::Registration().

◆ AlgorithmName()

virtual QString Isis::AdaptiveGruen::AlgorithmName ( ) const
inlineprotectedvirtual

Return name of Algorithm.

Returns
QString The name of the algorithm

Reimplemented from Isis::Gruen.

Definition at line 83 of file AdaptiveGruen.h.

◆ AlgorithmStatistics()

Pvl Isis::Gruen::AlgorithmStatistics ( Pvl pvl)
protectedvirtualinherited

Create Gruen error and processing statistics Pvl output.

This method generates two groups specific to the Gruen algorithm: The GruenFailures group which logs all the errors enountered during processing and the GruenStatistics group which logs selected statistics gathered during a registration run.

These groups are added to the AutoReg log output Pvl container for reporting to user/log files.

Parameters
pvlInput AutoReg Pvl container to add results to
Returns
Pvl Output Pvl container with Gruen information

Reimplemented from Isis::AutoReg.

Definition at line 840 of file Gruen.cpp.

References Isis::PvlObject::addGroup(), Isis::Gruen::AlgorithmName(), Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::getNth(), Isis::Gruen::ParameterLog(), Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::size(), Isis::Gruen::StatsLog(), and Isis::toString().

◆ CallCount()

BigInt Isis::Gruen::CallCount ( ) const
inlineinherited

Returns the current call count.

Definition at line 101 of file Gruen.h.

◆ ChipLine()

double Isis::AutoReg::ChipLine ( ) const
inlineinherited

Return the search chip line that best matched.

Definition at line 351 of file AutoReg.h.

References Isis::AutoReg::p_chipLine.

◆ ChipSample()

double Isis::AutoReg::ChipSample ( ) const
inlineinherited

Return the search chip sample that best matched.

Definition at line 346 of file AutoReg.h.

References Isis::AutoReg::p_chipSample.

◆ CompareFits()

bool Isis::Gruen::CompareFits ( double  fit1,
double  fit2 
)
protectedvirtualinherited

This virtual method must return if the 1st fit is equal to or better than the second fit.

Parameters
fit11st goodness of fit
fit22nd goodness of fit

Reimplemented from Isis::AutoReg.

Definition at line 652 of file Gruen.cpp.

◆ CubeLine()

double Isis::AutoReg::CubeLine ( ) const
inlineinherited

Return the search chip cube line that best matched.

Definition at line 361 of file AutoReg.h.

References Isis::AutoReg::p_cubeLine.

Referenced by Isis::SmtkMatcher::makeRegisteredPoint(), Isis::ControlPointEdit::registerPoint(), and Isis::ControlMeasureEditWidget::registerPoint().

◆ CubeSample()

double Isis::AutoReg::CubeSample ( ) const
inlineinherited

Return the search chip cube sample that best matched.

Definition at line 356 of file AutoReg.h.

References Isis::AutoReg::p_cubeSample.

Referenced by Isis::SmtkMatcher::makeRegisteredPoint(), Isis::ControlPointEdit::registerPoint(), and Isis::ControlMeasureEditWidget::registerPoint().

◆ Distance()

void Isis::AutoReg::Distance ( double &  sampDistance,
double &  lineDistance 
)
inlineinherited

Return the distance point moved.

Parameters
sampDistanceSample movement
lineDistanceLine movement

Definition at line 326 of file AutoReg.h.

References Isis::AutoReg::p_lineMovement, and Isis::AutoReg::p_sampMovement.

Referenced by Isis::ControlPointEdit::registerPoint(), and Isis::ControlMeasureEditWidget::registerPoint().

◆ DistanceTolerance()

double Isis::AutoReg::DistanceTolerance ( ) const
inlineinherited

Return distance tolerance.

Definition at line 316 of file AutoReg.h.

References Isis::AutoReg::p_distanceTolerance.

Referenced by Isis::ControlPointEdit::registerPoint(), and Isis::ControlMeasureEditWidget::registerPoint().

◆ errorAnalysis()

Analysis Isis::Gruen::errorAnalysis ( const BigInt npts,
const double &  resid,
const GMatrix &  atai 
)
protectedinherited

Compute the error analysis of convergent Gruen matrix.

Author
kbecker (5/15/2011)
Parameters
npts
resid
atai
Returns
Analysis

Definition at line 305 of file Gruen.cpp.

References Isis::Gruen::DegreesOfFreedom(), Isis::Gruen::EigenSort(), Isis::Gruen::Jacobi(), Isis::Gruen::logError(), and Isis::IException::toString().

Referenced by Isis::Gruen::MatchAlgorithm(), and Isis::Gruen::Registration().

◆ FitChip()

Chip* Isis::AutoReg::FitChip ( )
inlineinherited

Return pointer to fit chip.

Definition at line 228 of file AutoReg.h.

References Isis::AutoReg::p_fitChip.

Referenced by Isis::ControlPointEdit::saveChips(), and Isis::ControlMeasureEditWidget::saveChips().

◆ getAffineConstraint()

double Isis::Gruen::getAffineConstraint ( ) const
inlineinherited

Returns the Affine tolerance constraint as read from config file.

Definition at line 111 of file Gruen.h.

Referenced by Isis::Gruen::CheckConstraints().

◆ getAffineRadio()

const AffineRadio& Isis::Gruen::getAffineRadio ( ) const
inlineinherited

Return current state of Affine/Radio state.

Definition at line 120 of file Gruen.h.

Referenced by Isis::Gruen::init().

◆ getAffineTolerance()

AffineTolerance Isis::Gruen::getAffineTolerance ( ) const
inherited

Return set of tolerances for affine convergence.

Author
kbecker (5/15/2011)
Returns
Tolerance Affine tolerances from PVL setup

Definition at line 1082 of file Gruen.cpp.

Referenced by Isis::Gruen::Registration().

◆ getDefaultAffineRadio()

const AffineRadio& Isis::Gruen::getDefaultAffineRadio ( ) const
inlineinherited

Returns default settings for Affine/Radiometric parameters.

Definition at line 117 of file Gruen.h.

Referenced by Isis::Gruen::setAffineRadio().

◆ getLastMatch()

MatchPoint Isis::Gruen::getLastMatch ( ) const
inlineinherited

Returns the register state of the last successful Gruen match.

This method returns the full match condition of the last call to Gruen Register function that was successful.

BEWARE: This is only valid if Register returns successfully! This is due to AutoReg returning conditions that occur prior to the actual Gruen algorithm being called.

Author
Kris Becker - 6/4/2011
Returns
MatchPoint

Definition at line 136 of file Gruen.h.

Referenced by Isis::SmtkMatcher::makeRegisteredPoint().

◆ getSpiceConstraint()

double Isis::Gruen::getSpiceConstraint ( ) const
inlineinherited

Returns the SPICE tolerance constraint as read from config file.

Definition at line 108 of file Gruen.h.

Referenced by Isis::SmtkMatcher::makeRegisteredPoint().

◆ GoodnessOfFit()

double Isis::AutoReg::GoodnessOfFit ( ) const
inlineinherited

◆ IdealFit()

virtual double Isis::Gruen::IdealFit ( ) const
inlineprotectedvirtualinherited

Returns the ideal fit for a perfect Gruen result.

Implements Isis::AutoReg.

Definition at line 156 of file Gruen.h.

◆ IsAdaptive()

virtual bool Isis::AdaptiveGruen::IsAdaptive ( )
inlinevirtual

AdaptiveGruen is adaptive.

Returns
bool Always True

Definition at line 73 of file AdaptiveGruen.h.

◆ IsIdeal()

bool Isis::AutoReg::IsIdeal ( double  fit)
inlineinherited

Returns true if the fit parameter is arbitrarily close to the ideal fit value.

Parameters
fitFit value to be compared to the ideal fit
Returns
bool Indicates whether the fit is ideal

Definition at line 1175 of file AutoReg.cpp.

◆ MatchAlgorithm()

double Isis::Gruen::MatchAlgorithm ( Chip pattern,
Chip subsearch 
)
protectedvirtualinherited

Minimization of data set using Gruen algorithm.

This is a very minimal application of the Gruen algorithm that provides the ability to use it in a non-adaptive capacity. This method processes two chips of the same size, pattern and subsearch. The subsearch has typically been extracted in the same manner as the MinimumDifference or MaximumCorrelation routines are utilized.

It simply applies the algorithm to the current state of the two chips, computes the error analysis on it and returns the eigen vector solution as an indication of chip registration integrity.

Note that in this mode, most all the parameters found in the definition file that apply to the adaptive mode are ignored when utilizing the algorithm in this fashion.

Parameters
pattern[in] A Chip object usually containing an nxm area of a cube. Must be the same diminsions as subsearch.
subsearch[in] A Chip object usually containing an nxm area of a cube. Must be the same dimensions as pattern. This is normally a subarea of a larger portion of the image.
Returns
The square root of the eigen values of DN differences OR Isis::NULL if the Gruen algorithm fails.

Implements Isis::AutoReg.

Definition at line 624 of file Gruen.cpp.

References Isis::Gruen::algorithm(), Isis::Gruen::errorAnalysis(), Isis::Gruen::getDefaultRadio(), Isis::Analysis::getEigen(), and Isis::Null.

◆ MinimumZScore()

double Isis::AutoReg::MinimumZScore ( ) const
inlineinherited

Return minimumPatternZScore.

Definition at line 366 of file AutoReg.h.

References Isis::AutoReg::p_minimumPatternZScore.

Referenced by Isis::ControlPointEdit::registerPoint(), and Isis::ControlMeasureEditWidget::registerPoint().

◆ MostLenientTolerance()

virtual double Isis::AutoReg::MostLenientTolerance ( )
inlinevirtualinherited

Minimum tolerance specific to algorithm.

Reimplemented in Isis::MinimumDifference.

Definition at line 386 of file AutoReg.h.

◆ Parse()

void Isis::AutoReg::Parse ( Pvl pvl)
protectedinherited

Initialize parameters in the AutoReg class using a PVL specification.

An example of the PVL required for this is:

Object = AutoRegistration
Group = Algorithm
Name = MaximumCorrelation
Tolerance = 0.7
EndGroup
Group = PatternChip
Samples = 21
Lines = 21
EndGroup
Group = SearchChip
Samples = 51
Lines = 51
EndGroup
EndObject

There are many other options that can be set via the pvl and are described in other documentation (see below).

See also
patternMatch.doc under the coreg application
Parameters
pvlThe pvl object containing the specification
Exceptions
iException::User"Improper format for AutoReg PVL."
History:

2010-06-15 Jeannie Walldren - Added ability to read ChipInterpolator keyword from the Algorithm group.

2010-07-20 Jeannie Walldren - Added ability to read search sub chip valid percent

Definition at line 207 of file AutoReg.cpp.

References _FILEINFO_, Isis::PvlContainer::fileName(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), Isis::ValidMaximum, and Isis::ValidMinimum.

◆ PatternChip()

Chip* Isis::AutoReg::PatternChip ( )
inlineinherited

Return pointer to pattern chip.

Definition at line 218 of file AutoReg.h.

References Isis::AutoReg::p_patternChip.

Referenced by Isis::ControlPointEdit::registerPoint(), and Isis::ControlMeasureEditWidget::registerPoint().

◆ PatternValidPercent()

double Isis::AutoReg::PatternValidPercent ( ) const
inlineinherited

◆ Reduce()

Chip Isis::AutoReg::Reduce ( Chip chip,
int  reductionFactor 
)
protectedinherited

This method reduces the given chip by the given reduction factor.

Used to speed up the match algorithm.

Parameters
chipChip to be reduced
reductionFactorFactor by which to reduce chip.
Returns
Chip Reduced chip object

Definition at line 552 of file AutoReg.cpp.

References Isis::Statistics::AddData(), Isis::Statistics::Average(), Isis::Chip::GetValue(), Isis::Chip::Lines(), Isis::Null, Isis::Statistics::Reset(), Isis::Chip::Samples(), and Isis::Chip::SetValue().

◆ ReducedFitChip()

Chip* Isis::AutoReg::ReducedFitChip ( )
inlineinherited

Return pointer to reduced fit chip.

Definition at line 263 of file AutoReg.h.

References Isis::AutoReg::p_reducedFitChip.

◆ ReducedPatternChip()

Chip* Isis::AutoReg::ReducedPatternChip ( )
inlineinherited

Return pointer to reduced pattern chip.

Definition at line 253 of file AutoReg.h.

References Isis::AutoReg::p_reducedPatternChip.

◆ ReducedSearchChip()

Chip* Isis::AutoReg::ReducedSearchChip ( )
inlineinherited

Return pointer to reduced search chip.

Definition at line 258 of file AutoReg.h.

References Isis::AutoReg::p_reducedSearchChip.

◆ ReductionFactor()

int Isis::AutoReg::ReductionFactor ( )
inlineinherited

Return the reduction factor.

Definition at line 291 of file AutoReg.h.

References Isis::AutoReg::p_reduceFactor.

◆ Register()

AutoReg::RegisterStatus Isis::AutoReg::Register ( )
inherited

Walk the pattern chip through the search chip to find the best registration.

Returns
AutoReg::RegisterStatus Returns the status of the registration.
Exceptions
iException::User- "Search chips samples must be at least N pixels wider than the pattern chip samples for successful surface modeling"
iException::User- "Search chips lines must be at least N pixels taller than the pattern chip lines for successful surface modeling"
iException::User- "Reduction factor is too large"

Prep for walking the search chip by computing the starting and ending sample and line positions of the search chip to extract a sub-search chip to compare with the pattern chip.

Because the sub-search chip needs to have the same pixel dimensions as the pattern chip, and will be composed from its center pixel outwards, buffer the start and end boundaries so an area the size of the pattern chip can always be extracted around the current position.

For example, consider trying to extract a 5x5 sub-search chip from some search chip. If one starts at sample 1 and line 1, then because the "current position" is treated as the center of the sub-search chip, the algorithm could not form a 5x5 chip because there is nothing up and to the left of the current position. Consequently, for this example, there needs to be a two-pixel buffer from the edge of the search chip as the algorithm walks through it to make sure a 5x5 sub-search chip can always be extracted with the current position as its center.

Definition at line 600 of file AutoReg.cpp.

References _FILEINFO_, Isis::Chip::CubeLine(), Isis::Chip::CubeSample(), Isis::Chip::IsValid(), Isis::Chip::Lines(), Isis::Null, Isis::Chip::Samples(), Isis::Chip::SetChipPosition(), Isis::Chip::TackLine(), and Isis::Chip::TackSample().

Referenced by Isis::SmtkMatcher::makeRegisteredPoint(), Isis::ControlPointEdit::registerPoint(), and Isis::ControlMeasureEditWidget::registerPoint().

◆ Registration()

AutoReg::RegisterStatus Isis::Gruen::Registration ( Chip sChip,
Chip pChip,
Chip fChip,
int  startSamp,
int  startLine,
int  endSamp,
int  endLine,
int  bestSamp,
int  bestLine 
)
protectedvirtualinherited

Applies the adaptive Gruen algorithm to pattern and search chips.

This method computes the adaptive Gruen algorithm for a pattern chip and search chip. The search chip is assumed to be of a larger size than the pattern chip as dictated by the contents of the registration definition file.

This algorithm can be used with or without "fast geoming" the search chip. It works quite well where the two images are assumed to be nearly spatially registered. Its real intent is to compute parallax angles between two images taken at different viewing geometry. This provides an efficient process for deriving a digital elevation model (DEM) from two datasets.

The Gruen algorithm is applied to the chips until the algorithm converges (current iteration yields a detla affine within tolerance limits), an error is encountered, or the maximum number of iterations is exceeded.

Note that bestSamp and bestLine may not be the original center of the search chip. It is subject to chip reduction matching as specified by the user. All distance tolerances are compute from this postion. The process of chip reduction processing is handled by AutoReg prior to calling this routine.

See also
getThreshHold() for Affine limit information
Parameters
sChipFull search chip as rendered from the search image
pChipFull pattern chip as rendered from the pattern/match image
fChipMaintains the solution vector at each chip location
startSampStarting sample of the search image range
startLineStarting line of the search image range
endSampEnding sample of the search image range
endLineEnding line of the search image range
bestSampBest registering sample of search chip
bestLinebest registering line of search chip
Returns
AutoReg::RegisterStatus Returns AutoReg::Success if the chip is successfully registered, otherwise returns AutoReg::AdaptiveAlgorithmFailed.

Reimplemented from Isis::AutoReg.

Definition at line 696 of file Gruen.cpp.

References Isis::Gruen::algorithm(), Isis::Gruen::CheckConstraints(), Isis::Gruen::errorAnalysis(), Isis::Chip::Extract(), Isis::Gruen::getAffineTolerance(), Isis::Gruen::getChipUpdate(), Isis::Threshold::hasConverged(), Isis::Chip::Lines(), Isis::Gruen::logError(), Isis::Chip::Samples(), Isis::AutoReg::SetChipLine(), Isis::Chip::SetChipPosition(), Isis::AutoReg::SetChipSample(), Isis::AutoReg::SetGoodnessOfFit(), Isis::Chip::SetSize(), Isis::Gruen::Status(), Isis::Chip::TackLine(), Isis::Chip::TackSample(), Isis::AffineRadio::Translate(), and Isis::Chip::Write().

◆ RegistrationPatternChip()

Chip* Isis::AutoReg::RegistrationPatternChip ( )
inlineinherited

◆ RegistrationSearchChip()

Chip* Isis::AutoReg::RegistrationSearchChip ( )
inlineinherited

◆ RegistrationStatistics()

Pvl Isis::AutoReg::RegistrationStatistics ( )
inherited

This returns the cumulative registration statistics.

That is, the Register() method accumulates statistics regard the errors each time is called. Invoking this method returns a PVL summary of those statisitics

Author
janderson (3/26/2009)
Returns
Pvl

Definition at line 1190 of file AutoReg.cpp.

References Isis::PvlObject::addGroup(), and Isis::toString().

◆ RegTemplate()

PvlGroup Isis::AutoReg::RegTemplate ( )
inherited

This function returns the keywords that this object was created from.

Returns
PvlGroup The keywords this object used in initialization

Definition at line 1229 of file AutoReg.cpp.

References Isis::PvlContainer::hasKeyword().

◆ SearchChip()

Chip* Isis::AutoReg::SearchChip ( )
inlineinherited

Return pointer to search chip.

Definition at line 223 of file AutoReg.h.

References Isis::AutoReg::p_searchChip.

Referenced by Isis::ControlPointEdit::registerPoint(), and Isis::ControlMeasureEditWidget::registerPoint().

◆ setAffineRadio() [1/2]

void Isis::Gruen::setAffineRadio ( const AffineRadio affrad)
inherited

Sets initial chip transformation.

This method can be used with AutoReg registration to set initial affine transform parameters. This initial condition will be applied to the whole search chip extraction for the first subsearch chip. The caller must define the contents of the affine and radiometric parameters. See the AffineRadio construct for details.

Author
kbecker (5/14/2011)
Parameters
affradInitial Affine/Radio parameters to apply on registration entry

Definition at line 127 of file Gruen.cpp.

◆ setAffineRadio() [2/2]

void Isis::Gruen::setAffineRadio ( )
inherited

Set affine parameters to defaults.

This method differs from the one above in that it uses the defaults as defined at construction. The basic difference is that this call sets the affine portion to the identity and the radiometric parameters to the defaults as provided in the user input auto-regististration parameters. It may have default shift and gain values to use.

Author
Kris Becker - 6/4/2011

Definition at line 143 of file Gruen.cpp.

References Isis::Gruen::getDefaultAffineRadio().

◆ SetChipInterpolator()

void Isis::AutoReg::SetChipInterpolator ( const QString &  interpolator)
inherited

Sets the Chip class interpolator type to be used to load pattern and search chips.

Acceptable values for the interpolator parameter include:

  • NearestNeighborType
  • BiLinearType
  • CubicConvolutionType

If this method is not called, the chip interpolator type defaults to CubicConvolutionType in the Chip class.

Parameters
interpolatorName of interpolator type to be used. This is taken from the Pvl's ChipInterpolator keyword value.
Exceptions
iException::User- "Invalid Interpolator type."
Author
Jeannie Walldren
History:
2010-06-15 Jeannie Walldren - Original version.

Definition at line 453 of file AutoReg.cpp.

References _FILEINFO_.

◆ SetChipLine()

void Isis::AutoReg::SetChipLine ( double  line)
inlineprotectedinherited

Sets the search chip subpixel line that matches the pattern tack line.

Parameters
lineValue to set for search chip subpixel line

Definition at line 420 of file AutoReg.h.

References Isis::AutoReg::p_chipLine.

Referenced by Isis::Gruen::Registration().

◆ SetChipSample()

void Isis::AutoReg::SetChipSample ( double  sample)
inlineprotectedinherited

Sets the search chip subpixel sample that matches the pattern tack sample.

Parameters
sampleValue to set for search chip subpixel sample

Definition at line 409 of file AutoReg.h.

References Isis::AutoReg::p_chipSample.

Referenced by Isis::Gruen::Registration().

◆ SetGoodnessOfFit()

void Isis::AutoReg::SetGoodnessOfFit ( double  fit)
inlineprotectedinherited

Sets the goodness of fit for adaptive algorithms.

Parameters
fitFit value to set

Definition at line 429 of file AutoReg.h.

References Isis::AutoReg::p_bestFit.

Referenced by Isis::Gruen::Registration().

◆ SetGradientFilterType()

void Isis::AutoReg::SetGradientFilterType ( const QString &  gradientFilterType)
inherited

Set the gradient filter type to be applied to the search and pattern chips.

Parameters
gradientFilterTypethe gradient filter type to use
Exceptions
iException::User- "Invalid Gradient type."

Definition at line 286 of file AutoReg.cpp.

◆ SetPatternValidPercent()

void Isis::AutoReg::SetPatternValidPercent ( const double  percent)
inherited

Set the amount of data in the pattern chip that must be valid.

For example, a 21x21 pattern chip has 441 pixels. If percent is 75 then at least 330 pixels pairs must be valid in order for a comparision between the pattern and search sub-region to occur. That is, both the pattern pixel and search pixel must be valid to be counted. Pixels are considered valid based on the min/max range specified on each of the Chips (see Chip::SetValidRange method).

If the pattern chip reduction option is used this percentage will apply to all reduced patterns. Additionally, the pattern sampling effects the pixel count. For example if pattern sampling is 50% then only 220 pixels in the 21x21 pattern are considered so 165 must be valid.

If this method is not called, the PatternChip ValidPercent defaults to 50 in the AutoReg object constructor.

See also
SetValidRange()
Parameters
percentPercentage of valid data between 0 and 100, default is 50% if never invoked
Exceptions
iException::User- "Invalid value for PatternChip ValidPercent."

Definition at line 352 of file AutoReg.cpp.

References _FILEINFO_.

◆ SetPatternZScoreMinimum()

void Isis::AutoReg::SetPatternZScoreMinimum ( double  minimum)
inherited

Set the minimum pattern zscore.

This option is used to ignore pattern chips which are bland (low standard deviation). If the minimum or maximum pixel value in the pattern chip does not meet the minimum zscore value (see a statisitcs book for definition of zscore) then invalid registration will occur.

If this method is not called, the z-score minimum defaults to 1.0 in the AutoReg object constructor.

Parameters
minimumThe minimum zscore value for the pattern chip. Default is 1.0
Exceptions
iException::User- "Invalid value for PatternChip MinimumZScore."

Definition at line 407 of file AutoReg.cpp.

References _FILEINFO_.

◆ SetReductionFactor()

void Isis::AutoReg::SetReductionFactor ( int  factor)
inherited

Set the reduction factor used to speed up the pattern matching algorithm.

If this method is not called, the reduction factor defaults to 1 in the AutoReg object constructor.

Parameters
factorReduction factor. Must be greater than or equal to 1.
Exceptions
iException::User- "Invalid value for Algorithm ReductionFactor."

Definition at line 534 of file AutoReg.cpp.

References _FILEINFO_.

◆ SetSubPixelAccuracy()

void Isis::AutoReg::SetSubPixelAccuracy ( bool  on)
inherited

If the sub-pixel accuracy is enabled, the Register() method will attempt to match the pattern chip to the search chip at sub-pixel accuracy, otherwise it will be registered at whole pixel accuracy.

If this method is not called, the sub pixel accuracy defaults to on = true in the AutoReg object constructor.

Parameters
onSet the state of registration accuracy. The default is sub-pixel accuracy is on

Definition at line 325 of file AutoReg.cpp.

◆ SetSubpixelPosition()

bool Isis::AutoReg::SetSubpixelPosition ( Chip window)
protectedinherited

Set the search chip sample and line to subpixel values if possible.

This method uses a centroiding method to gravitate the whole pixel best fit to a subpixel extremum in the continuous image space. The weights of the centers of gravity in the centroiding algorithm are modeled by goodness of fit values within a discrete search window.

Parameters
windowThe search window extracted from the fit chip
Returns
bool Returns true if the subpixel solution is valid

Definition at line 1100 of file AutoReg.cpp.

References Isis::Chip::ChipLine(), Isis::Chip::ChipSample(), Isis::Chip::GetValue(), Isis::Chip::Lines(), Isis::Chip::Samples(), Isis::Centroid::select(), Isis::Centroid::setDNRange(), and Isis::Chip::SetValue().

◆ SetSubsearchValidPercent()

void Isis::AutoReg::SetSubsearchValidPercent ( const double  percent)
inherited

Set the amount of data in the search chip's subchip that must be valid.

If this method is not called, the SearchChip SubchipValidPercent defaults to 50 in the AutoReg object constructor.

Parameters
percentPercentage of valid data between 0 and 100, default is 50% if never invoked
See also
SetPatternValidPercent()
Exceptions
iException::User- "Invalid value for SearchChip SubchipValidPercent."
Author
2010-07-20 Jeannie Walldren
History:
2010-07-20 Jeannie Walldren - Original Version.

Definition at line 380 of file AutoReg.cpp.

References _FILEINFO_.

◆ SetSurfaceModelDistanceTolerance()

void Isis::AutoReg::SetSurfaceModelDistanceTolerance ( double  distance)
inherited

Set a distance the surface model solution is allowed to move away from the best whole pixel fit in the fit chip.

If this method is not called, the distance tolerance defaults to 1.5 in the AutoReg object constructor.

Parameters
distanceThe distance allowed to move in pixels. Must be greater than 0.
Exceptions
iException::User- "Invalid value for SurfaceModel DistanceTolerance."

Definition at line 514 of file AutoReg.cpp.

References _FILEINFO_.

◆ SetSurfaceModelWindowSize()

void Isis::AutoReg::SetSurfaceModelWindowSize ( int  size)
inherited

Set the surface model window size.

The pixels in this window will be used to fit a surface model in order to compute sub-pixel accuracy. In some cases the default (3x3) and produces erroneous sub-pixel accuracy values.

If this method is not called, the window size defaults to 5 in the AutoReg object constructor.

Parameters
sizeThe size of the window must be three or greater and odd.
Exceptions
iException::User- "Invalid value for SurfaceModel WindowSize."

Definition at line 493 of file AutoReg.cpp.

References _FILEINFO_.

◆ SetTolerance()

void Isis::AutoReg::SetTolerance ( double  tolerance)
inherited

Set the tolerance for an acceptable goodness of fit.

If this method is not called, the tolerance value defaults to Isis::Null in the AutoReg object constructor.

Parameters
toleranceThis tolerance is used to test against the goodness of fit returned by the MatchAlgorith method after a surface model has been fit. See TestGoodnessOfFit

Definition at line 429 of file AutoReg.cpp.

◆ SubPixelAccuracy()

bool Isis::AutoReg::SubPixelAccuracy ( )
inlineinherited

Return whether this object will attempt to register to whole or sub-pixel accuracy.

Returns
on Is sub-pixel accuracy enabled?

Definition at line 286 of file AutoReg.h.

References Isis::AutoReg::p_subpixelAccuracy.

◆ SubsearchValidPercent()

double Isis::AutoReg::SubsearchValidPercent ( ) const
inlineinherited

Return subsearch chip valid percent.

Definition at line 301 of file AutoReg.h.

References Isis::AutoReg::p_subsearchValidPercent.

◆ Success()

bool Isis::AutoReg::Success ( ) const
inlineinherited

Return whether the match algorithm succeeded or not.

Definition at line 334 of file AutoReg.h.

References Isis::AutoReg::p_registrationStatus, Isis::AutoReg::SuccessPixel, and Isis::AutoReg::SuccessSubPixel.

Referenced by Isis::ControlPointEdit::registerPoint(), and Isis::ControlMeasureEditWidget::registerPoint().

◆ Tolerance()

double Isis::AutoReg::Tolerance ( ) const
inlineinherited

◆ UpdatedTemplate()

PvlGroup Isis::AutoReg::UpdatedTemplate ( )
inherited

Returns a PvlGroup containing the PvlKeywords of the parameters this object was most recently run with.

Because of publically accessible mutators, AutoReg's runtime parameters can change, and this version of the template is designed to reflect the paramters it was actually run with, as opposed to simply initialized with. If no mutators were ever called externally, then this PvlGroup should be the same as the one received from RegTemplate().

Returns
PvlGroup The keywords this object was most recently run with

Definition at line 1302 of file AutoReg.cpp.

References Isis::Chip::Lines(), Isis::Chip::Samples(), and Isis::toString().

◆ WindowSize()

double Isis::AutoReg::WindowSize ( ) const
inlineinherited

Return window size.

Definition at line 311 of file AutoReg.h.

References Isis::AutoReg::p_windowSize.

◆ WriteSubsearchChips()

void Isis::Gruen::WriteSubsearchChips ( const QString &  pattern = "SubChip")
inherited

Set up for writing subsearch for a a given registration call.

This method is provided to request the write of the subsearch chip at each iteration. This must be invoked prior to every call to AutoReg::Register() method. It will only write subchips from the Register() interface as it interates to a solution. Direct calls to Gruen methods don't iterate in the same fashion.

The "pattern" parameter is optional but is provided to direct the location and naming convention of each subsearch chip. The format for the output file name for each subsearch chip is comprised of the pattern parameter, call number, which can be retrieved by the CallCount() method and pertains to the call after the Register() method is invoked and the interation count. Below is a code example:

Gruen gruen(myPvldef);
// Set up pattern and search chips here
gruen.WriteSubsearchChips("/mydata/subchip");
gruen.Register();

Note that prior to each call to Register(), it must be called again in order for the subchips to be written. The last part of the parameter above, "subchip", cannot be a directory, but is a filename prefix. Assuming this is the first call to Register(), a series of cube subsearch chips will be written with the pattern "/work1/kbecker/subchipC000001IXXX.cub" where "C" indicates call count and the next 6 digits are the return of CallCount() method, "I" indicates the iteration count "XXX" of the algorithm() method. Note that the chip written for a particular iteration is what is provided as a parameter into the algorithm() method.

Parameters
patternSpecifies an optional directory and file pattern to write the subsearch chip at each algorithm iteration.

Definition at line 108 of file Gruen.cpp.

◆ ZScores()

void Isis::AutoReg::ZScores ( double &  score1,
double &  score2 
) const
inlineinherited

Return the ZScores of the pattern chip.

Parameters
score1First Z Score
score2Second Z Score

Definition at line 376 of file AutoReg.h.

References Isis::AutoReg::p_zScoreMax, and Isis::AutoReg::p_zScoreMin.

Referenced by Isis::ControlPointEdit::registerPoint(), Isis::ControlMeasureEditWidget::registerPoint(), Isis::ControlPointEdit::saveMeasure(), and Isis::ControlMeasureEditWidget::saveMeasure().

Member Data Documentation

◆ p_template

PvlObject Isis::AutoReg::p_template
protectedinherited

AutoRegistration object that created this projection.

Definition at line 465 of file AutoReg.h.


The documentation for this class was generated from the following file: