Hugintrunk
0.1
|
This class implements the Random Sample Consensus (RanSac) framework, a framework for robust parameter estimation. More...
#include <ransac.h>
Classes | |
class | SubSetIndexComparator |
Static Public Member Functions | |
template<class Estimator , class S , class T > | |
static std::vector< const T * > | compute (S ¶meters, std::vector< int > &inliers, const Estimator ¶mEstimator, const std::vector< T > &data, double desiredProbabilityForNoOutliers, double maximalOutlierPercentage) |
Estimate the model parameters using the RanSac framework. More... | |
template<class Estimator , class S , class T > | |
static std::vector< const T * > | compute (S ¶meters, const Estimator ¶mEstimator, const std::vector< T > &data) |
Estimate the model parameters using the maximal consensus set by going over ALL possible subsets (brute force approach). More... | |
Static Private Member Functions | |
static unsigned int | choose (unsigned int n, unsigned int m) |
Compute n choose m [ n!/(m!*(n-m)!)]. More... | |
template<class Estimator , class T > | |
static void | computeAllChoices (const Estimator ¶mEstimator, const std::vector< T > &data, int numForEstimate, short *bestVotes, short *curVotes, int &numVotesForBest, int startIndex, int n, int k, int arrIndex, int *arr) |
template<class Estimator , class T , class S > | |
static void | estimate (const Estimator ¶mEstimator, const std::vector< T > &data, int numForEstimate, short *bestVotes, short *curVotes, int &numVotesForBest, int *arr) |
This class implements the Random Sample Consensus (RanSac) framework, a framework for robust parameter estimation.
Given data containing outliers we estimate the model parameters using sub-sets of the original data:
This is based on: Fischler M.A., Bolles R.C., ``Random Sample Consensus: A Paradigm for Model Fitting with Applications to Image Analysis and Automated Cartography'', Communications of the ACM, Vol. 24(6), 1981.
Hartely R., Zisserman A., "Multiple View Geometry in Computer Vision"
The class template parameters are T - objects used for the parameter estimation (e.g. Point2D in line estimation, std::pair<Point2D,Point2D> in homography estimation). S - type of parameters (e.g. std::vector<double>).
Author: Ziv Yaniv
Small modifications by Pablo d'Angelo:
|
inlinestaticprivate |
|
static |
Estimate the model parameters using the RanSac framework.
parameters | A vector which will contain the estimated parameters. If there is an error in the input then this vector will be empty. Errors are: 1. Less data objects than required for an exact fit.
|
paramEstimator | An object which can estimate the desired parameters using either an exact fit or a least squares fit. |
data | The input from which the parameters will be estimated. |
numForEstimate | The number of data objects required for an exact fit. |
desiredProbabilityForNoOutliers | The probability that at least one of the selected subsets doesn't contains an outlier. |
maximalOutlierPercentage | The maximal expected percentage of outliers. |
Definition at line 175 of file ransac.h.
References choose(), vigra_ext::log(), and vigra_ext::pow().
Referenced by HuginBase::RANSACOptimizer::findInliers().
|
static |
Estimate the model parameters using the maximal consensus set by going over ALL possible subsets (brute force approach).
Given: n - data.size() k - numForEstimate
(n-k)! * k!
parameters | A vector which will contain the estimated parameters. If there is an error in the input then this vector will be empty. Errors are: 1. Less data objects than required for an exact fit.
|
paramEstimator | An object which can estimate the desired parameters using either an exact fit or a least squares fit. |
data | The input from which the parameters will be estimated. |
numForEstimate | The number of data objects required for an exact fit. |
NOTE: This method should be used only when n choose k is small (i.e. k or (n-k) are approximatly equal to n)
Definition at line 327 of file ransac.h.
References computeAllChoices().
|
staticprivate |
|
staticprivate |
Definition at line 387 of file ransac.h.
Referenced by computeAllChoices().