#include <randomSampleSelector.h>
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. | |
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.
| 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.
| 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.
| dlr::computerVision::RandomSampleSelector< Sample >::RandomSampleSelector | ( | IterType | beginIter, | |
| IterType | endIter | |||
| ) | [inline] |
The constructor specifies the full population of samples from which to randomly select.
| 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.
| 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().
Definition at line 83 of file randomSampleSelector.h.
| 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.
Definition at line 96 of file randomSampleSelector.h.
| 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().
| sampleSize | This argument specifies how many elements should be in the returned sequence. |
Definition at line 167 of file randomSampleSelector.h.
| 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.
| 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. |
Definition at line 182 of file randomSampleSelector.h.
1.5.8