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

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

#include <randomSampleSelector.h>

Inheritance diagram for dlr::computerVision::RandomSampleSelector< Sample >:
[legend]

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 >
 RandomSampleSelector (IterType beginIter, IterType endIter)
 The constructor specifies the full population of samples from which to randomly select.
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 getRandomSample (size_t sampleSize)
 This member function returns a SampleSequenceType instance drawn randomly (without replacement) from the sample population.
template<class IterType >
SampleSequenceType getSubset (IterType beginIter, IterType endIter)
 This member function has very limited usefulness.


Detailed Description

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

This class template provides capabilities to randomly 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 random samples will be drawn.

Definition at line 36 of file randomSampleSelector.h.


Member Typedef Documentation

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

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

See getRandomSample(size_t) for more information.

Reimplemented in dlr::computerVision::RansacProblem< Sample, Model >.

Definition at line 53 of file randomSampleSelector.h.

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

This typedef simply mirrors template argument Sample.

Reimplemented in dlr::computerVision::RansacProblem< Sample, Model >.

Definition at line 44 of file randomSampleSelector.h.


Constructor & Destructor Documentation

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

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

Parameters:
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 69 of file randomSampleSelector.h.


Member Function Documentation

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

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

This sequence will remain valid at least until the next call to getRandomSample() or getSubset().

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

Definition at line 83 of file randomSampleSelector.h.

template<class Sample>
size_t dlr::computerVision::RandomSampleSelector< 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 96 of file randomSampleSelector.h.

template<class Sample >
RandomSampleSelector< Sample >::SampleSequenceType dlr::computerVision::RandomSampleSelector< Sample >::getRandomSample ( size_t  sampleSize  )  [inline]

This member function returns a SampleSequenceType instance drawn randomly (without replacement) from the sample population.

This sequence will remain valid at least until the next call to getRandomSample() or getSubset().

Parameters:
sampleSize This argument specifies how many elements should be in the returned sequence.
Returns:
The return value is a sequence containing the the requested number of randomly selected samples.

Definition at line 167 of file randomSampleSelector.h.

template<class Sample >
template<class IterType >
RandomSampleSelector< Sample >::SampleSequenceType dlr::computerVision::RandomSampleSelector< Sample >::getSubset ( IterType  beginIter,
IterType  endIter 
) [inline]

This member function has very limited usefulness.

Following a call to getPool(), you can compute a sequence of bools (or values that will implicitly cast to bools) indicating which samples you like, pass this sequence to getSubset(), and get back a SampleSequenceType instance containing just the samples you requested. In the current implementation, the (internal) ordering of the sample population changes with each call to getRandomSample() or getSubset(), so if there's been a call to either getRandomSample() or getSubset() more recently than your last call to getPool(), then this function will return unexpected results.

Parameters:
beginIter This argument and the next specify the sequenc of indicators specifying which elements should be in the output sequence. Elements for which the indicator is true will be included in the sequence, while elements for which the indicator is false will not.
endIter This argument and the next specify the sequenc of indicators specifying which elements should be in the output sequence.
Returns:
The return value is a sequence containing the requested samples.

Definition at line 182 of file randomSampleSelector.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