Package com.irurueta.geometry.refiners
Class PlaneCorrespondenceProjectiveTransformation3DRefiner
java.lang.Object
com.irurueta.geometry.refiners.Refiner<ProjectiveTransformation3D>
com.irurueta.geometry.refiners.InliersDataRefiner<ProjectiveTransformation3D>
com.irurueta.geometry.refiners.PairMatchesAndInliersDataRefiner<ProjectiveTransformation3D,Plane,Plane>
com.irurueta.geometry.refiners.ProjectiveTransformation3DRefiner<Plane,Plane>
com.irurueta.geometry.refiners.PlaneCorrespondenceProjectiveTransformation3DRefiner
public class PlaneCorrespondenceProjectiveTransformation3DRefiner
extends ProjectiveTransformation3DRefiner<Plane,Plane>
A 3D projective transformation refiner using plane correspondences.
This class takes into account an initial estimation, inlier line matches
and their residuals 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 TypeFieldDescriptionprivate final PlanePlane to be reused when computing residuals.Fields inherited from class com.irurueta.geometry.refiners.PairMatchesAndInliersDataRefiner
samples1, samples2Fields inherited from class com.irurueta.geometry.refiners.InliersDataRefiner
inliers, numInliers, residualsFields inherited from class com.irurueta.geometry.refiners.Refiner
covariance, DEFAULT_KEEP_COVARIANCE, initialEstimation, keepCovariance, listener, locked -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.PlaneCorrespondenceProjectiveTransformation3DRefiner(ProjectiveTransformation3D initialEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData, List<Plane> samples1, List<Plane> samples2, double refinementStandardDeviation) Constructor.PlaneCorrespondenceProjectiveTransformation3DRefiner(ProjectiveTransformation3D initialEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers, List<Plane> samples1, List<Plane> samples2, double refinementStandardDeviation) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanrefine(ProjectiveTransformation3D result) Refines provided initial estimation.private doubleresidual(ProjectiveTransformation3D transformation, Plane inputPlane, Plane outputPlane) Computes the residual between the projective transformation and a pair of matched planes.private doubletotalResidual(ProjectiveTransformation3D transformation) Computes total residual among all provided inlier samples.Methods inherited from class com.irurueta.geometry.refiners.ProjectiveTransformation3DRefiner
getRefinementStandardDeviation, refine, setRefinementStandardDeviationMethods inherited from class com.irurueta.geometry.refiners.PairMatchesAndInliersDataRefiner
getSamples1, getSamples2, isReady, setSamples1, setSamples2Methods inherited from class com.irurueta.geometry.refiners.InliersDataRefiner
getInliers, getNumInliers, getResiduals, getTotalSamples, setInliers, setInliersData, setNumInliers, setResidualsMethods inherited from class com.irurueta.geometry.refiners.Refiner
getCovariance, getInitialEstimation, getListener, isCovarianceKept, isLocked, setCovarianceKept, setInitialEstimation, setListener
-
Field Details
-
residualTestPlane
Plane to be reused when computing residuals.
-
-
Constructor Details
-
PlaneCorrespondenceProjectiveTransformation3DRefiner
public PlaneCorrespondenceProjectiveTransformation3DRefiner()Constructor. -
PlaneCorrespondenceProjectiveTransformation3DRefiner
public PlaneCorrespondenceProjectiveTransformation3DRefiner(ProjectiveTransformation3D initialEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers, List<Plane> samples1, List<Plane> samples2, double refinementStandardDeviation) 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.samples1- 1st set of paired samples.samples2- 2nd set of paired samples.refinementStandardDeviation- standard deviation used for Levenberg-Marquardt fitting.
-
PlaneCorrespondenceProjectiveTransformation3DRefiner
public PlaneCorrespondenceProjectiveTransformation3DRefiner(ProjectiveTransformation3D initialEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData, List<Plane> samples1, List<Plane> samples2, double refinementStandardDeviation) 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.samples1- 1st set of paired samples.samples2- 2nd set of paired samples.refinementStandardDeviation- standard deviation used for Levenberg-Marquardt fitting.
-
-
Method Details
-
refine
public boolean refine(ProjectiveTransformation3D result) throws NotReadyException, LockedException, RefinerException Refines provided initial estimation. This method always sets a value into provided result instance regardless of the fact that error has actually improved in LMSE terms or not.- Specified by:
refinein classRefiner<ProjectiveTransformation3D>- Parameters:
result- instance where refined estimation will be stored.- Returns:
- true if result improves (error decreases) in LMSE terms respect to initial estimation, false if no improvement has been achieved.
- Throws:
NotReadyException- if not enough input data has been provided.LockedException- if estimator is locked because refinement is already in progress.RefinerException- if refinement fails for some reason (e.g. unable to converge to a result).
-
residual
private double residual(ProjectiveTransformation3D transformation, Plane inputPlane, Plane outputPlane) Computes the residual between the projective transformation and a pair of matched planes.- Parameters:
transformation- a transformation.inputPlane- input 3D plane.outputPlane- output 3D plane.- Returns:
- residual.
-
totalResidual
Computes total residual among all provided inlier samples.- Parameters:
transformation- a transformation.- Returns:
- total residual.
-