dlr::computerVision::NChooseKSampleSelector< Sample > Class Template Reference

This class template provides capabilities to exhaustively select sequences of samples from a pool of candidates. More...

#include <nChooseKSampleSelector.h>

List of all members.

Public Types

typedef Sample SampleType
 This typedef simply mirrors template argument Sample.
typedef std::pair< typename
std::vector< SampleType >
::const_iterator, typename
std::vector< SampleType >
::const_iterator > 
SampleSequenceType
 This typedef specifies what type will be used to represent sequences of samples.

Public Member Functions

template<class IterType >
 NChooseKSampleSelector (size_t sampleSize, IterType beginIter, IterType endIter)
 The constructor specifies the full population of samples from which to exhaustively select.
size_t getNumberOfSamples ()
 This member function returns the number of distinct combinations of sampleSize elements that can be drawn from the sequence passed to the constructor.
SampleSequenceType getPool ()
 This member function returns a SampleSequenceType instance containing the entire population passed to the constructor.
size_t getPoolSize ()
 This member function returns a the number of samples in the entire population passed to the constructor.
SampleSequenceType getSample (size_t sampleNumber)
 This member function returns a SampleSequenceType instance drawn from the sample population.


Detailed Description

template<class Sample>
class dlr::computerVision::NChooseKSampleSelector< Sample >

This class template provides capabilities to exhaustively select sequences of samples from a pool of candidates.

It is useful for implementing robust statistics algorithms such as RANSAC.

Template argument Sample specifies what type of thing will make up the population from which samples will be drawn.

Definition at line 34 of file nChooseKSampleSelector.h.


Member Typedef Documentation

template<class Sample>
typedef std::pair<typename std::vector<SampleType>::const_iterator, typename std::vector<SampleType>::const_iterator> dlr::computerVision::NChooseKSampleSelector< Sample >::SampleSequenceType

This typedef specifies what type will be used to represent sequences of samples.

See getSample(size_t) for more information.

Definition at line 51 of file nChooseKSampleSelector.h.

template<class Sample>
typedef Sample dlr::computerVision::NChooseKSampleSelector< Sample >::SampleType

This typedef simply mirrors template argument Sample.

Definition at line 42 of file nChooseKSampleSelector.h.


Constructor & Destructor Documentation

template<class Sample >
template<class IterType >
dlr::computerVision::NChooseKSampleSelector< Sample >::NChooseKSampleSelector ( size_t  sampleSize,
IterType  beginIter,
IterType  endIter 
) [inline]

The constructor specifies the full population of samples from which to exhaustively select.

Parameters:
sampleSize This argument specifies the size of the samples that will be drawn from the input sequence. The number of elements in the sequence [beginIter, endIter] must be at least this large.
beginIter This argument and the next specify a sequence from which to copy the sample population.
endIter This argument and the previous specify a sequence from which to copy the sample population.

Definition at line 167 of file nChooseKSampleSelector.h.


Member Function Documentation

template<class Sample >
size_t dlr::computerVision::NChooseKSampleSelector< Sample >::getNumberOfSamples (  )  [inline]

This member function returns the number of distinct combinations of sampleSize elements that can be drawn from the sequence passed to the constructor.

Returns:
The return value is "N choose M," where N is the size of the sequence passed to the constructor, and M is the value of constructor argument sampleSize.

Definition at line 193 of file nChooseKSampleSelector.h.

template<class Sample>
SampleSequenceType dlr::computerVision::NChooseKSampleSelector< Sample >::getPool (  )  [inline]

This member function returns a SampleSequenceType instance containing the entire population passed to the constructor.

Returns:
The return value is a sequence containing the entire population.

Definition at line 98 of file nChooseKSampleSelector.h.

template<class Sample>
size_t dlr::computerVision::NChooseKSampleSelector< Sample >::getPoolSize (  )  [inline]

This member function returns a the number of samples in the entire population passed to the constructor.

Returns:
The return value is the size of the entire population.

Definition at line 111 of file nChooseKSampleSelector.h.

template<class Sample >
NChooseKSampleSelector< Sample >::SampleSequenceType dlr::computerVision::NChooseKSampleSelector< Sample >::getSample ( size_t  sampleNumber  )  [inline]

This member function returns a SampleSequenceType instance drawn from the sample population.

This sequence will remain valid at least until the next call to getSample().

Parameters:
sampleNumber This argument specifies which of the available samples should be returned. Its value should be in the range 0 <= sampleNumber < this->getNumberOfSamples(). This function is more efficient if the value of sampleNumber starts at 0 and is incremented with each cal to getSample().
Returns:
The return value is a sequence containing the requested sample.

Definition at line 210 of file nChooseKSampleSelector.h.


The documentation for this class was generated from the following file:

Generated on Wed Nov 25 12:15:09 2009 for dlrComputerVision Utility Library by  doxygen 1.5.8