RandomSample applies a random sampling with uniform probability. More...
#include <pcl/filters/random_sample.h>


Public Types | |
| typedef boost::shared_ptr < RandomSample< PointT > > | Ptr |
| typedef boost::shared_ptr < const RandomSample< PointT > > | ConstPtr |
Public Member Functions | |
| RandomSample (bool extract_removed_indices=false) | |
| Empty constructor. | |
| void | setSample (unsigned int sample) |
| Set number of indices to be sampled. | |
| unsigned int | getSample () |
| Get the value of the internal sample parameter. | |
| void | setSeed (unsigned int seed) |
| Set seed of random function. | |
| unsigned int | getSeed () |
| Get the value of the internal seed parameter. | |
Protected Member Functions | |
| void | applyFilter (PointCloud &output) |
| Sample of point indices into a separate PointCloud. | |
| void | applyFilter (std::vector< int > &indices) |
| Sample of point indices. | |
| float | unifRand () |
| Return a random number fast using a LCG (Linear Congruential Generator) algorithm. | |
Protected Attributes | |
| unsigned int | sample_ |
| Number of indices that will be returned. | |
| unsigned int | seed_ |
| Random number seed. | |
RandomSample applies a random sampling with uniform probability.
Based off Algorithm A from the paper "Faster Methods for Random Sampling" by Jeffrey Scott Vitter. The algorithm runs in O(N) and results in sorted indices http://www.ittc.ku.edu/~jsv/Papers/Vit84.sampling.pdf
Definition at line 56 of file random_sample.h.
| typedef boost::shared_ptr< const RandomSample<PointT> > pcl::RandomSample< PointT >::ConstPtr |
Reimplemented from pcl::FilterIndices< PointT >.
Definition at line 75 of file random_sample.h.
| typedef boost::shared_ptr< RandomSample<PointT> > pcl::RandomSample< PointT >::Ptr |
Reimplemented from pcl::FilterIndices< PointT >.
Definition at line 74 of file random_sample.h.
| pcl::RandomSample< PointT >::RandomSample | ( | bool | extract_removed_indices = false |
) | [inline] |
Empty constructor.
Definition at line 78 of file random_sample.h.
References pcl::Filter< PointT >::filter_name_.
| void pcl::RandomSample< PointT >::applyFilter | ( | std::vector< int > & | indices | ) | [inline, protected, virtual] |
Sample of point indices.
| indices | the resultant point cloud indices |
Implements pcl::FilterIndices< PointT >.
Definition at line 93 of file random_sample.hpp.
References pcl::Filter< PointT >::extract_removed_indices_, pcl::PCLBase< PointT >::indices_, pcl::FilterIndices< PointT >::negative_, pcl::Filter< PointT >::removed_indices_, pcl::RandomSample< PointT >::sample_, pcl::RandomSample< PointT >::seed_, and pcl::RandomSample< PointT >::unifRand().
| void pcl::RandomSample< PointT >::applyFilter | ( | PointCloud & | output | ) | [inline, protected, virtual] |
Sample of point indices into a separate PointCloud.
| output | the resultant point cloud |
Implements pcl::Filter< PointT >.
Definition at line 48 of file random_sample.hpp.
References pcl::copyPointCloud(), pcl::Filter< PointT >::extract_removed_indices_, pcl::getFields(), pcl::PCLBase< PointT >::input_, pcl::PointCloud< PointT >::is_dense, pcl::FilterIndices< PointT >::keep_organized_, pcl::Filter< PointT >::removed_indices_, and pcl::FilterIndices< PointT >::user_filter_value_.
| unsigned int pcl::RandomSample< PointT >::getSample | ( | ) | [inline] |
Get the value of the internal sample parameter.
Definition at line 98 of file random_sample.h.
References pcl::RandomSample< PointT >::sample_.
| unsigned int pcl::RandomSample< PointT >::getSeed | ( | ) | [inline] |
Get the value of the internal seed parameter.
Definition at line 115 of file random_sample.h.
References pcl::RandomSample< PointT >::seed_.
| void pcl::RandomSample< PointT >::setSample | ( | unsigned int | sample | ) | [inline] |
Set number of indices to be sampled.
| sample |
Definition at line 90 of file random_sample.h.
References pcl::RandomSample< PointT >::sample_.
| void pcl::RandomSample< PointT >::setSeed | ( | unsigned int | seed | ) | [inline] |
Set seed of random function.
| seed |
Definition at line 107 of file random_sample.h.
References pcl::RandomSample< PointT >::seed_.
| float pcl::RandomSample< PointT >::unifRand | ( | ) | [inline, protected] |
Return a random number fast using a LCG (Linear Congruential Generator) algorithm.
See http://software.intel.com/en-us/articles/fast-random-number-generator-on-the-intel-pentiumr-4-processor/ for more information.
Definition at line 143 of file random_sample.h.
Referenced by pcl::RandomSample< PointT >::applyFilter().
unsigned int pcl::RandomSample< PointT >::sample_ [protected] |
Number of indices that will be returned.
Definition at line 123 of file random_sample.h.
Referenced by pcl::RandomSample< PointT >::applyFilter(), pcl::RandomSample< PointT >::getSample(), and pcl::RandomSample< PointT >::setSample().
unsigned int pcl::RandomSample< PointT >::seed_ [protected] |
Random number seed.
Definition at line 125 of file random_sample.h.
Referenced by pcl::RandomSample< PointT >::applyFilter(), pcl::RandomSample< PointT >::getSeed(), and pcl::RandomSample< PointT >::setSeed().