Class RobustEstimator<T>

java.lang.Object
com.irurueta.numerical.robust.RobustEstimator<T>
Type Parameters:
T - Object to be estimated (i.e. lines, cameras, etc)
Direct Known Subclasses:
LMedSRobustEstimator, MSACRobustEstimator, PROMedSRobustEstimator, PROSACRobustEstimator, RANSACRobustEstimator

public abstract class RobustEstimator<T> extends Object
Robust estimator to estimate some object in a robust manner
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float
    Default amount of progress variation before notifying a change in estimation progress.
    Listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    protected boolean
    Indicates if this estimator is locked because an estimation is being computed.
    static final float
    Maximum allowed value for progress delta.
    static final float
    Minimum allowed value for progress delta
    protected float
    Amount of progress variation before notifying a progress change during estimation.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
    protected
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract T
    Robustly estimates an instance of T.
    abstract InliersData
    Returns data about inliers once estimation has been done.
    Returns reference to listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    Returns method being used for robust estimation.
    float
    Returns amount of progress variation before notifying a progress change during estimation.
    boolean
    Indicates whether listener has been provided and is available for retrieval.
    boolean
    Indicates if this instance is locked because estimation is being computed.
    boolean
    Indicates if estimator is ready to start the estimation process.
    void
    Sets listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    void
    setProgressDelta(float progressDelta)
    Sets amount of progress variation before notifying a progress change during estimation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_PROGRESS_DELTA

      public static final float DEFAULT_PROGRESS_DELTA
      Default amount of progress variation before notifying a change in estimation progress. By default, this is set to 5%
      See Also:
    • MIN_PROGRESS_DELTA

      public static final float MIN_PROGRESS_DELTA
      Minimum allowed value for progress delta
      See Also:
    • MAX_PROGRESS_DELTA

      public static final float MAX_PROGRESS_DELTA
      Maximum allowed value for progress delta.
      See Also:
    • listener

      protected RobustEstimatorListener<T> listener
      Listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    • locked

      protected volatile boolean locked
      Indicates if this estimator is locked because an estimation is being computed.
    • progressDelta

      protected float progressDelta
      Amount of progress variation before notifying a progress change during estimation.
  • Constructor Details

    • RobustEstimator

      protected RobustEstimator()
      Constructor.
    • RobustEstimator

      protected RobustEstimator(RobustEstimatorListener<T> listener)
      Constructor.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
  • Method Details

    • getListener

      public RobustEstimatorListener<T> getListener()
      Returns reference to listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Returns:
      listener to be notified of events.
    • setListener

      public void setListener(RobustEstimatorListener<T> listener) throws LockedException
      Sets listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Parameters:
      listener - listener to be notified of events.
      Throws:
      LockedException - if robust estimator is locked.
    • isListenerAvailable

      public boolean isListenerAvailable()
      Indicates whether listener has been provided and is available for retrieval.
      Returns:
      true if available, false otherwise.
    • isLocked

      public boolean isLocked()
      Indicates if this instance is locked because estimation is being computed.
      Returns:
      true if locked, false otherwise.
    • getProgressDelta

      public float getProgressDelta()
      Returns amount of progress variation before notifying a progress change during estimation.
      Returns:
      amount of progress variation before notifying a progress change during estimation.
    • setProgressDelta

      public void setProgressDelta(float progressDelta) throws LockedException
      Sets amount of progress variation before notifying a progress change during estimation.
      Parameters:
      progressDelta - amount of progress variation before notifying a progress change during estimation.
      Throws:
      IllegalArgumentException - if progress delta is less than zero or greater than 1.
      LockedException - if this estimator is locked because an estimation is being computed.
    • estimate

      public abstract T estimate() throws LockedException, NotReadyException, RobustEstimatorException
      Robustly estimates an instance of T.
      Returns:
      estimated object.
      Throws:
      LockedException - if robust estimator is locked.
      NotReadyException - if provided input data is not enough to start the estimation.
      RobustEstimatorException - if estimation fails for any reason (i.e. numerical instability, no solution available, etc).
    • getInliersData

      public abstract InliersData getInliersData()
      Returns data about inliers once estimation has been done.
      Returns:
      data about inliers or null if estimation has not been done.
    • getMethod

      public abstract RobustEstimatorMethod getMethod()
      Returns method being used for robust estimation.
      Returns:
      method being used for robust estimation.
    • isReady

      public boolean isReady()
      Indicates if estimator is ready to start the estimation process.
      Returns:
      true if ready, false otherwise.