#include <itkRANSAC.h>
RANSAC for various usecases such as plane estimation, point set registration.
Definition at line 77 of file itkRANSAC.h.
Inheritance diagram for itk::RANSAC< T, SType, TTransform >:
Collaboration diagram for itk::RANSAC< T, SType, TTransform >:Classes | |
| class | SubSetIndexComparator |
Public Types | |
| typedef SmartPointer< const Self > | ConstPointer |
| using | ParametersEstimatorPointer = typename itk::ParametersEstimator<T, SType>::Pointer |
| using | ParametersEstimatorType = typename itk::ParametersEstimator<T, SType> |
| typedef SmartPointer< Self > | Pointer |
| typedef RANSAC | Self |
| typedef Object | Superclass |
Public Types inherited from itk::Object | |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = Object |
| using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = LightObject |
Public Member Functions | |
| std::vector< double > | Compute (std::vector< SType > ¶meters, double desiredProbabilityForNoOutliers) |
| virtual::itk::LightObject::Pointer | CreateAnother () const |
| double | GetCheckCorrespondenceEdgeLength () |
| bool | GetCheckCorresspondenceDistance () |
| virtual const char * | GetNameOfClass () const |
| unsigned int | GetNumberOfThreads () |
| void | SetAgreeData (std::vector< T > &data) |
| void | SetCheckCorrespondenceEdgeLength (double inputLength) |
| void | SetCheckCorresspondenceDistance (bool inputFlag) |
| void | SetData (std::vector< T > &data) |
| void | SetMaxIteration (unsigned int maxIteration) |
| void | SetNumberOfThreads (unsigned int numberOfThreads) |
| void | SetParametersEstimator (ParametersEstimatorType *paramEstimator) |
Public Member Functions inherited from itk::Object | |
| unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
| unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
| virtual void | DebugOff () const |
| virtual void | DebugOn () const |
| Command * | GetCommand (unsigned long tag) |
| bool | GetDebug () const |
| MetaDataDictionary & | GetMetaDataDictionary () |
| const MetaDataDictionary & | GetMetaDataDictionary () const |
| virtual ModifiedTimeType | GetMTime () const |
| virtual const TimeStamp & | GetTimeStamp () const |
| bool | HasObserver (const EventObject &event) const |
| void | InvokeEvent (const EventObject &) |
| void | InvokeEvent (const EventObject &) const |
| virtual void | Modified () const |
| void | Register () const override |
| void | RemoveAllObservers () |
| void | RemoveObserver (unsigned long tag) const |
| void | SetDebug (bool debugFlag) const |
| void | SetReferenceCount (int) override |
| void | UnRegister () const noexcept override |
| void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
| void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
| virtual void | SetObjectName (std::string _arg) |
| virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
| Pointer | Clone () const |
| virtual void | Delete () |
| virtual int | GetReferenceCount () const |
| void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
| static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
| static bool | GetGlobalWarningDisplay () |
| static void | GlobalWarningDisplayOff () |
| static void | GlobalWarningDisplayOn () |
| static Pointer | New () |
| static void | SetGlobalWarningDisplay (bool val) |
Static Public Member Functions inherited from itk::LightObject | |
| static void | BreakOnError () |
| static Pointer | New () |
Protected Member Functions | |
| RANSAC () | |
| ~RANSAC () override | |
Protected Member Functions inherited from itk::Object | |
| Object () | |
| bool | PrintObservers (std::ostream &os, Indent indent) const |
| void | PrintSelf (std::ostream &os, Indent indent) const override |
| virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
| ~Object () override | |
Protected Member Functions inherited from itk::LightObject | |
| virtual LightObject::Pointer | InternalClone () const |
| LightObject () | |
| virtual void | PrintHeader (std::ostream &os, Indent indent) const |
| virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
| virtual | ~LightObject () |
Private Member Functions | |
| unsigned int | Choose (unsigned int n, unsigned int m) |
Static Private Member Functions | |
| static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | RANSACThreadCallback (void *arg) |
Private Attributes | |
| std::vector< T > | agreeData |
| unsigned int | allTries |
| double | bestRMSE { std::numeric_limits<double>::max() } |
| bool * | bestVotes |
| double | checkCorrespondenceEdgeLengthTest = 0 |
| bool | checkCorresspondenceDistanceFlag = false |
| std::set< int *, SubSetIndexComparator > * | chosenSubSets |
| std::vector< T > | data |
| std::mutex | hypothesisMutex |
| unsigned int | maxIteration { std::numeric_limits<unsigned int>::max() } |
| unsigned int | numberOfThreads |
| double | numerator |
| unsigned int | numTries |
| unsigned int | numVotesForBest |
| ParametersEstimator< T, SType >::Pointer | paramEstimator |
| std::vector< double > | parametersRansac |
| std::mutex | resultsMutex |
Additional Inherited Members | |
Protected Attributes inherited from itk::LightObject | |
| std::atomic< int > | m_ReferenceCount {} |
| typedef SmartPointer<const Self> itk::RANSAC< T, SType, TTransform >::ConstPointer |
Definition at line 85 of file itkRANSAC.h.
| using itk::RANSAC< T, SType, TTransform >::ParametersEstimatorPointer = typename itk::ParametersEstimator<T, SType>::Pointer |
Definition at line 86 of file itkRANSAC.h.
| using itk::RANSAC< T, SType, TTransform >::ParametersEstimatorType = typename itk::ParametersEstimator<T, SType> |
Definition at line 87 of file itkRANSAC.h.
| typedef SmartPointer<Self> itk::RANSAC< T, SType, TTransform >::Pointer |
Definition at line 84 of file itkRANSAC.h.
| typedef RANSAC itk::RANSAC< T, SType, TTransform >::Self |
Definition at line 82 of file itkRANSAC.h.
| typedef Object itk::RANSAC< T, SType, TTransform >::Superclass |
Definition at line 83 of file itkRANSAC.h.
|
protected |
Construct an instance of the RANSAC algorithm. The number of threads used in the computation is 1, valid values are in [1, #cores].
Referenced by GetNameOfClass().
|
overrideprotected |
|
private |
Compute n choose m [ n!/(m!*(n-m)!)]. If choose(n,m)>std::numeric_limits<unsigned int>::max(), or there is an overflow during the computations then we return std::numeric_limits<unsigned int>::max(), otherwise the correct value is returned.
| std::vector< double > itk::RANSAC< T, SType, TTransform >::Compute | ( | std::vector< SType > & | parameters, |
| double | desiredProbabilityForNoOutliers ) |
Estimate the model parameters using the RANSAC framework.
| parameters | A vector which will contain the estimated parameters. If there is an error then this vector will be empty. Errors are: 1. Parameter estimation object or data not set, see SetParameterEstimator and SetData.
|
| desiredProbabilityForNoOutliers | The probability that at least one of the selected subsets doesn't contain an outlier, must be in (0,1). |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
| double itk::RANSAC< T, SType, TTransform >::GetCheckCorrespondenceEdgeLength | ( | ) |
| bool itk::RANSAC< T, SType, TTransform >::GetCheckCorresspondenceDistance | ( | ) |
|
virtual |
| unsigned int itk::RANSAC< T, SType, TTransform >::GetNumberOfThreads | ( | ) |
|
static |
New method for creating an object using a factory.
|
staticprivate |
| void itk::RANSAC< T, SType, TTransform >::SetAgreeData | ( | std::vector< T > & | data | ) |
For usecases such as registration using features where the random selection data is different from the agree data use this method to set the agree data.
| data | The input on which the number of agreement samples will be counted. |
References data.
| void itk::RANSAC< T, SType, TTransform >::SetCheckCorrespondenceEdgeLength | ( | double | inputLength | ) |
| void itk::RANSAC< T, SType, TTransform >::SetCheckCorresspondenceDistance | ( | bool | inputFlag | ) |
| void itk::RANSAC< T, SType, TTransform >::SetData | ( | std::vector< T > & | data | ) |
Set the data objects we want to use (e.g. point pairs for estimating a homography.
| data | The input from which the parameters will be estimated. |
References data.
| void itk::RANSAC< T, SType, TTransform >::SetMaxIteration | ( | unsigned int | maxIteration | ) |
References maxIteration.
| void itk::RANSAC< T, SType, TTransform >::SetNumberOfThreads | ( | unsigned int | numberOfThreads | ) |
Set/Get the number of threads used by the RANSAC implementation.
| numberOfThreads | Number of threads the algorithm uses. Valid values are in [1, #cores]. |
References numberOfThreads.
| void itk::RANSAC< T, SType, TTransform >::SetParametersEstimator | ( | ParametersEstimatorType * | paramEstimator | ) |
Set the function object that is able to estimate the desired parametric entity (e.g. PlaneParametersEstimator).
| paramEstimator | An object which can estimate the desired parameters using both an exact fit and a least squares fit. |
References paramEstimator.
|
private |
Definition at line 226 of file itkRANSAC.h.
|
private |
Definition at line 235 of file itkRANSAC.h.
|
private |
Definition at line 223 of file itkRANSAC.h.
|
private |
Definition at line 221 of file itkRANSAC.h.
|
private |
Definition at line 214 of file itkRANSAC.h.
|
private |
Definition at line 213 of file itkRANSAC.h.
|
private |
Definition at line 230 of file itkRANSAC.h.
|
private |
Definition at line 225 of file itkRANSAC.h.
Referenced by SetAgreeData(), and SetData().
|
private |
Definition at line 238 of file itkRANSAC.h.
|
private |
Definition at line 211 of file itkRANSAC.h.
Referenced by SetMaxIteration().
|
private |
Definition at line 210 of file itkRANSAC.h.
Referenced by SetNumberOfThreads().
|
private |
Definition at line 234 of file itkRANSAC.h.
|
private |
Definition at line 232 of file itkRANSAC.h.
|
private |
Definition at line 222 of file itkRANSAC.h.
|
private |
Definition at line 237 of file itkRANSAC.h.
Referenced by SetParametersEstimator().
|
private |
Definition at line 227 of file itkRANSAC.h.
|
private |
Definition at line 239 of file itkRANSAC.h.