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

public abstract class InliersDataRefiner<T> extends Refiner<T>
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 Details

    • inliers

      protected BitSet inliers
      Array indicating which of the provided matches are inliers.
    • residuals

      protected double[] residuals
      Residuals 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 numInliers
      Number 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

      public BitSet getInliers()
      Gets set indicating which of the provided matches are inliers.
      Returns:
      set indicating which of the provided matches are inliers.
    • setInliers

      public void setInliers(BitSet inliers) throws LockedException
      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

      public void setResiduals(double[] residuals) throws LockedException
      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

      public void setNumInliers(int numInliers) throws LockedException
      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.