ViSP  2.6.2
vpRansac< vpTransformation > Class Template Reference

#include <vpRansac.h>

Static Public Member Functions

static bool ransac (unsigned int npts, vpColVector &x, unsigned int s, double t, vpColVector &model, vpColVector &inliers, int consensus=1000, double areaThreshold=0.0, const int maxNbumbersOfTrials=10000)

Detailed Description

template<class vpTransformation>
class vpRansac< vpTransformation >

This class is a generic implementation of the Ransac algorithm. It cannot be used alone.

Creation: june, 15 2005

RANSAC is described in :

M.A. Fishler and R.C. Boles. "Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography". Comm. Assoc. Comp, Mach., Vol 24, No 6, pp 381-395, 1981

Richard Hartley and Andrew Zisserman. "Multiple View Geometry in Computer Vision". pp 101-113. Cambridge University Press, 2001

The code of this class is inspired by : Peter Kovesi School of Computer Science & Software Engineering The University of Western Australia pk at csse uwa edu au

See also

Definition at line 93 of file vpRansac.h.

Member Function Documentation

template<class vpTransformation >
bool vpRansac< vpTransformation >::ransac ( unsigned int  npts,
vpColVector x,
unsigned int  s,
double  t,
vpColVector M,
vpColVector inliers,
int  consensus = 1000,
double  areaThreshold = 0.0,
const int  maxNbumbersOfTrials = 10000 

RANSAC - Robustly fits a model to data with the RANSAC algorithm.

npts: The number of data points.
x: Data sets to which we are seeking to fit a model M It is assumed that x is of size [d x Npts] where d is the dimensionality of the data and npts is the number of data points.
s: The minimum number of samples from x required by fitting fn to fit a model.
t: The distance threshold between data point and the model used to decide whether a point is an inlier or not.
M: The model having the greatest number of inliers.
inliers: An array of indices of the elements of x that were the inliers for the best model.
consensus: Consensus
areaThreshold: Not used.
maxNbumbersOfTrials: Maximum number of trials. Even if a solution is not found, the method is stopped.

Definition at line 138 of file vpRansac.h.

References vpException::fatalError, vpMath::maximum(), vpMath::minimum(), vpERROR_TRACE, and vpTRACE.

Referenced by vpPose::ransac(), and vpHomography::ransac().