Package com.irurueta.numerical.robust
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
Robust estimator to estimate some object in a robust manner
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final float
Default amount of progress variation before notifying a change in estimation progress.protected RobustEstimatorListener<T>
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 deltaprotected float
Amount of progress variation before notifying a progress change during estimation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor.protected
RobustEstimator
(RobustEstimatorListener<T> listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract T
estimate()
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.abstract RobustEstimatorMethod
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
isLocked()
Indicates if this instance is locked because estimation is being computed.boolean
isReady()
Indicates if estimator is ready to start the estimation process.void
setListener
(RobustEstimatorListener<T> listener) 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.
-
Field Details
-
DEFAULT_PROGRESS_DELTA
public static final float DEFAULT_PROGRESS_DELTADefault 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_DELTAMinimum allowed value for progress delta- See Also:
-
MAX_PROGRESS_DELTA
public static final float MAX_PROGRESS_DELTAMaximum allowed value for progress delta.- See Also:
-
listener
Listener to be notified of events such as when estimation starts, ends or its progress significantly changes. -
locked
protected volatile boolean lockedIndicates if this estimator is locked because an estimation is being computed. -
progressDelta
protected float progressDeltaAmount of progress variation before notifying a progress change during estimation.
-
-
Constructor Details
-
RobustEstimator
protected RobustEstimator()Constructor. -
RobustEstimator
Constructor.- Parameters:
listener
- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
-
-
Method Details
-
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
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
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
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
Returns data about inliers once estimation has been done.- Returns:
- data about inliers or null if estimation has not been done.
-
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.
-