14#include "Statistics.h"
262 QString GradientFilterString()
const;
310 void Distance(
double &sampDistance,
double &lineDistance) {
327 inline bool IsIdeal(
double fit);
360 void ZScores(
double &score1,
double &score2)
const {
418 Chip &fChip,
int startSamp,
int startLine,
int endSamp,
int endLine,
419 int bestSamp,
int bestLine);
422 virtual bool CompareFits(
double fit1,
double fit2);
void ZScores(double &score1, double &score2) const
Return the ZScores of the pattern chip.
Isis::AutoReg::RegisterStatus p_registrationStatus
Registration status to be returned by Register().
double p_bestFit
Goodness of fit for adaptive algorithms.
double CubeLine() const
Return the search chip cube line that best matched.
RegisterStatus
Enumeration of the Register() method's return status.
@ PatternChipNotEnoughValidData
Not enough valid data in pattern chip.
@ SuccessPixel
Success registering to whole pixel.
@ PatternZScoreNotMet
Pattern data max or min does not pass the z-score test.
@ SurfaceModelSolutionInvalid
Could not model surface for sub-pixel accuracy.
@ SuccessSubPixel
Success registering to sub-pixel accuracy.
@ AdaptiveAlgorithmFailed
Error occured in Adaptive algorithm.
@ FitChipToleranceNotMet
Goodness of fit tolerance not satisfied.
@ FitChipNoData
Fit chip did not have any valid data.
@ SurfaceModelDistanceInvalid
Surface model moves registration more than one pixel.
@ SurfaceModelNotEnoughValidData
Not enough points to fit a surface model for sub-pixel accuracy.
double WindowSize() const
Return window size.
GradientFilterType
Enumeration of the different types of gradient filters that can be applied to the pattern and search ...
@ Sobel
Sobel gradient filter.
@ None
default, no gradient filter
int p_totalRegistrations
Registration Statistics Total keyword.
bool p_subpixelAccuracy
Indicates whether sub-pixel accuracy is enabled. Default is true.
double p_zScoreMax
Second Z-Score of pattern chip.
double p_lineMovement
The number of lines the point moved.
PvlGroup UpdatedTemplate()
Returns a PvlGroup containing the PvlKeywords of the parameters this object was most recently run wit...
void Init()
Initialize AutoReg object private variables.
double GoodnessOfFit() const
Return the goodness of fit of the match algorithm.
void Match(Chip &sChip, Chip &pChip, Chip &fChip, int startSamp, int endSamp, int startLine, int endLine)
Empty copy constructor.
Chip * RegistrationPatternChip()
Return pointer to pattern chip used in registration.
void SetChipLine(double line)
Sets the search chip subpixel line that matches the pattern tack line.
int p_fitChipNoDataCount
Registration statistics FitChipNoData keyword.
PvlObject p_template
AutoRegistration object that created this projection.
int p_patternChipNotEnoughValidDataCount
Registration statistics PatternNotEnoughValidData keyword.
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.
Chip p_searchChip
Chip to be searched for best registration.
AutoReg(Pvl &pvl)
Create AutoReg object.
Chip * ReducedPatternChip()
Return pointer to reduced pattern chip.
void Parse(Pvl &pvl)
Initialize parameters in the AutoReg class using a PVL specification.
bool IsIdeal(double fit)
Returns true if the fit parameter is arbitrarily close to the ideal fit value.
void ApplyGradientFilter(Chip &chip)
Run a gradient filter over the chip.
int p_pixelSuccesses
Registration statistics Success keyword.
Chip p_reducedFitChip
Fit Chip with reduction factor.
int ReductionFactor()
Return the reduction factor.
void SetSubsearchValidPercent(const double percent)
Set the amount of data in the search chip's subchip that must be valid.
PvlGroup RegTemplate()
This function returns the keywords that this object was created from.
void SetChipInterpolator(const QString &interpolator)
Sets the Chip class interpolator type to be used to load pattern and search chips.
double DistanceTolerance() const
Return distance tolerance.
int p_surfaceModelDistanceInvalidCount
Registration statistics SurfaceModelDistanceInvalid keyword.
double p_cubeSample
Cube sample.
AutoReg::GradientFilterType p_gradientFilterType
Type of gradient filter to use before matching.
Chip * RegistrationSearchChip()
Return pointer to search chip used in registration.
double p_cubeLine
Cube line.
int p_subpixelSuccesses
Registration statistics Success keyword.
bool Success() const
Return whether the match algorithm succeeded or not.
virtual double IdealFit() const =0
Returns the ideal (perfect) fit that could be returned by the MatchAlgorithm.
double PatternValidPercent() const
Return pattern chip valid percent. The default value is.
double p_chipLine
Chip line.
double p_zScoreMin
First Z-Score of pattern chip.
double p_chipSample
Chip sample.
Pvl RegistrationStatistics()
This returns the cumulative registration statistics.
int p_reduceFactor
Reduction factor.
int p_fitChipToleranceNotMetCount
Registration statistics FitChipToleranceNotMet keyword.
double p_tolerance
Tolerance for acceptable goodness of fit in match algorithm.
void SetPatternValidPercent(const double percent)
Set the amount of data in the pattern chip that must be valid.
int p_surfaceModelSolutionInvalidCount
Registration statistics SurfaceModelSolutionInvalid keyword.
double SubsearchValidPercent() const
Return subsearch chip valid percent.
Chip * SearchChip()
Return pointer to search chip.
virtual AutoReg::RegisterStatus Registration(Chip &sChip, Chip &pChip, Chip &fChip, int startSamp, int startLine, int endSamp, int endLine, int bestSamp, int bestLine)
Performs matching between the pattern and search at both whole-pixel and subpixel levels.
void SobelGradient(Buffer &in, double &v)
Compute a Sobel gradient based on an input buffer.
double ChipSample() const
Return the search chip sample that best matched.
void SetReductionFactor(int reductionFactor)
Set the reduction factor used to speed up the pattern matching algorithm.
double CubeSample() const
Return the search chip cube sample that best matched.
int p_bestLine
Line value of best fit.
bool SubPixelAccuracy()
Return whether this object will attempt to register to whole or sub-pixel accuracy.
int p_windowSize
Surface model window size.
void SetSubPixelAccuracy(bool on)
If the sub-pixel accuracy is enabled, the Register() method will attempt to match the pattern chip to...
double p_subsearchValidPercent
Percentage of data in subsearch chip that must be valid.
virtual double MostLenientTolerance()
Minimum tolerance specific to algorithm.
Chip p_reducedPatternChip
Pattern Chip with reduction factor.
bool ComputeChipZScore(Chip &chip)
This method computes the given Chip's Z-Score.
Chip Reduce(Chip &chip, int reductionFactor)
This method reduces the given chip by the given reduction factor.
int p_bestSamp
Sample value of best fit.
virtual ~AutoReg()
Destroy AutoReg object.
bool SetSubpixelPosition(Chip &window)
Set the search chip sample and line to subpixel values if possible.
Chip * ReducedSearchChip()
Return pointer to reduced search chip.
double MinimumZScore() const
Return minimumPatternZScore.
void SetPatternZScoreMinimum(double minimum)
Set the minimum pattern zscore.
virtual Pvl AlgorithmStatistics(Pvl &pvl)
Provide (adaptive) algorithms a chance to report results.
int p_surfaceModelNotEnoughValidDataCount
Registration statistics SurfaceModelNotEnoughValidData keyword.
void SetChipSample(double sample)
Sets the search chip subpixel sample that matches the pattern tack sample.
Chip p_gradientPatternChip
Chip to be matched with gradient applied.
double p_minimumPatternZScore
Minimum pattern Z-Score.
Chip p_gradientSearchChip
Chip to be searched for best registration with gradient applied.
void SetSurfaceModelDistanceTolerance(double distance)
Set a distance the surface model solution is allowed to move away from the best whole pixel fit in th...
void Distance(double &sampDistance, double &lineDistance)
Return the distance point moved.
Chip * FitChip()
Return pointer to fit chip.
Chip p_fitChip
Results from MatchAlgorithm() method.
Chip p_patternChip
Chip to be matched.
double ChipLine() const
Return the search chip line that best matched.
void SetTolerance(double tolerance)
Set the tolerance for an acceptable goodness of fit.
Chip * PatternChip()
Return pointer to pattern chip.
void SetGoodnessOfFit(double fit)
Sets the goodness of fit for adaptive algorithms.
int p_patternZScoreNotMetCount
Registration statistics PatternZScoreNotMet keyword.
virtual double MatchAlgorithm(Chip &pattern, Chip &subsearch)=0
Given two identically sized chips return a double that indicates how well they match.
Chip p_reducedSearchChip
Search Chip with reduction factor.
virtual QString AlgorithmName() const =0
Returns the name of the algorithm.
Chip * ReducedFitChip()
Return pointer to reduced fit chip.
void SetSurfaceModelWindowSize(int size)
Set the surface model window size.
double p_distanceTolerance
Maximum distance the surface model solution may be from the best whole pixel fit in the fit chip.
void SetGradientFilterType(const QString &gradientFilterType)
Set the gradient filter type to be applied to the search and pattern chips.
double p_goodnessOfFit
Goodness of fit of the match algorithm.
AutoReg::RegisterStatus Register()
Walk the pattern chip through the search chip to find the best registration.
double Tolerance() const
Return match algorithm tolerance.
double p_patternValidPercent
Percentage of data in pattern chip that must be valid.
double p_sampMovement
The number of samples the point moved.
Buffer for reading and writing cube data.
A small chip of data used for pattern matching.
Contains multiple PvlContainers.
Container for cube-like labels.
Contains Pvl Groups and Pvl Objects.
This is free and unencumbered software released into the public domain.