Class PointCorrespondenceAffineTransformation3DRefiner


public class PointCorrespondenceAffineTransformation3DRefiner extends AffineTransformation3DRefiner<Point3D,Point3D>
A 3D affine transformation refiner using point correspondences. This class takes into account an initial estimation, inlier point 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 Details

    • residualTestPoint

      private final Point3D residualTestPoint
      Point to be reused when computing residuals.
  • Constructor Details

    • PointCorrespondenceAffineTransformation3DRefiner

      public PointCorrespondenceAffineTransformation3DRefiner()
      Constructor.
    • PointCorrespondenceAffineTransformation3DRefiner

      public PointCorrespondenceAffineTransformation3DRefiner(AffineTransformation3D initialEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers, List<Point3D> samples1, List<Point3D> 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.
    • PointCorrespondenceAffineTransformation3DRefiner

      public PointCorrespondenceAffineTransformation3DRefiner(AffineTransformation3D initialEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData, List<Point3D> samples1, List<Point3D> 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

      Refines provide 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:
      refine in class Refiner<AffineTransformation3D>
      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(AffineTransformation3D transformation, Point3D inputPoint, Point3D outputPoint)
      Computes the residual between the affine transformation and a pair of matched points.
      Parameters:
      transformation - a transformation.
      inputPoint - input 3D point.
      outputPoint - output 3D point.
      Returns:
      residual.
    • totalResidual

      private double totalResidual(AffineTransformation3D transformation)
      Computes total residual among all provided inlier samples.
      Parameters:
      transformation - a transformation.
      Returns:
      total residual.