Package com.irurueta.geometry.refiners
Class InliersDataRefiner<T>
java.lang.Object
com.irurueta.geometry.refiners.Refiner<T>
com.irurueta.geometry.refiners.InliersDataRefiner<T>
- Type Parameters:
T- type of instance to be refined.
- Direct Known Subclasses:
PairMatchesAndInliersDataRefiner,SamplesAndInliersDataRefiner
Refines an instance of type T by taking into account an initial estimation,
inlier matches and their residuals.
This class can be used to find a solution that minimizes error of inliers in
LMSE terms.
Typically, a refiner is used by a robust estimator, however it can also be
useful in some other situations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BitSetArray indicating which of the provided matches are inliers.protected intNumber of inliers on initial estimation.protected double[]Residuals for matched data corresponding to the initial estimation.Fields inherited from class com.irurueta.geometry.refiners.Refiner
covariance, DEFAULT_KEEP_COVARIANCE, initialEstimation, keepCovariance, listener, locked -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedInliersDataRefiner(T initialEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData) Constructor.protectedInliersDataRefiner(T initialEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGets set indicating which of the provided matches are inliers.intGets number of inliers on initial estimation.double[]Gets residuals for matched samples corresponding to the initial estimation.intGets total number of provided matched samples.voidsetInliers(BitSet inliers) Specifies set indicating which of the provided matches are inliers.voidsetInliersData(com.irurueta.numerical.robust.InliersData inliersData) Sets inlier data.voidsetNumInliers(int numInliers) Sets number of inliers on initial estimation.voidsetResiduals(double[] residuals) Sets residuals for matched samples corresponding to the initial estimation.Methods inherited from class com.irurueta.geometry.refiners.Refiner
getCovariance, getInitialEstimation, getListener, isCovarianceKept, isLocked, isReady, refine, refine, setCovarianceKept, setInitialEstimation, setListener
-
Field Details
-
inliers
Array indicating which of the provided matches are inliers. -
residuals
protected double[] residualsResiduals for matched data corresponding to the initial estimation. Residuals are used to determine the amount of precision of each match in order to find a refined solution that minimizes the LMSE error of all inlier matches. -
numInliers
protected int numInliersNumber of inliers on initial estimation.
-
-
Constructor Details
-
InliersDataRefiner
protected InliersDataRefiner()Constructor. -
InliersDataRefiner
protected InliersDataRefiner(T initialEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers) Constructor.- Parameters:
initialEstimation- initial estimation to be set.keepCovariance- true if covariance of estimation must be kept after refinement, false otherwise.inliers- set indicating which of the provided matches are inliers.residuals- residuals for matched samples.numInliers- number of inliers on initial estimation.
-
InliersDataRefiner
protected InliersDataRefiner(T initialEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData) Constructor.- Parameters:
initialEstimation- initial estimation to be set.keepCovariance- true if covariance of estimation must be kept after refinement, false otherwise.inliersData- inlier data, typically obtained from a robust estimator.
-
-
Method Details
-
getInliers
Gets set indicating which of the provided matches are inliers.- Returns:
- set indicating which of the provided matches are inliers.
-
setInliers
Specifies set indicating which of the provided matches are inliers.- Parameters:
inliers- set indicating which of the provided matches are inliers.- Throws:
LockedException- if estimator is locked.
-
getResiduals
public double[] getResiduals()Gets residuals for matched samples corresponding to the initial estimation. Residuals are used to determine the amount of precision of each matched sample in order to find a refined solution that minimizes the LMSE error of all inlier matches.- Returns:
- residuals for matched samples.
-
setResiduals
Sets residuals for matched samples corresponding to the initial estimation. Residuals are used to determine the amount of precision of each matched sample in order to find a refined solution that minimizes the LMSE error of all inlier matches.- Parameters:
residuals- residuals for matched samples.- Throws:
LockedException- if estimator is locked.
-
getNumInliers
public int getNumInliers()Gets number of inliers on initial estimation.- Returns:
- number of inliers on initial estimation.
-
setNumInliers
Sets number of inliers on initial estimation.- Parameters:
numInliers- number of inliers on initial estimation.- Throws:
LockedException- if estimator is locked.IllegalArgumentException- if provided value is zero or negative.
-
getTotalSamples
public int getTotalSamples()Gets total number of provided matched samples.- Returns:
- total number of provided matched samples.
-
setInliersData
public void setInliersData(com.irurueta.numerical.robust.InliersData inliersData) throws LockedException Sets inlier data.- Parameters:
inliersData- inlier data, typically obtained from a robust estimator.- Throws:
LockedException- if estimator is locked.
-