38 #ifndef PCL_FILTERS_RANDOM_SUBSAMPLE_H_
39 #define PCL_FILTERS_RANDOM_SUBSAMPLE_H_
41 #include <pcl/filters/filter_indices.h>
55 template<
typename Po
intT>
74 typedef boost::shared_ptr< RandomSample<PointT> >
Ptr;
75 typedef boost::shared_ptr< const RandomSample<PointT> >
ConstPtr;
81 seed_ (static_cast<unsigned int> (time (NULL)))
145 return (static_cast<float>(rand () /
double (RAND_MAX)));
166 typedef boost::shared_ptr<RandomSample<pcl::PCLPointCloud2> >
Ptr;
167 typedef boost::shared_ptr<const RandomSample<pcl::PCLPointCloud2> >
ConstPtr;
170 RandomSample () : sample_ (UINT_MAX), seed_ (static_cast<unsigned int> (time (NULL)))
172 filter_name_ =
"RandomSample";
220 applyFilter (PCLPointCloud2 &output);
226 applyFilter (std::vector<int> &indices);
234 return (static_cast<float> (rand () /
double (RAND_MAX)));
240 #ifdef PCL_NO_PRECOMPILE
241 #include <pcl/filters/impl/random_sample.hpp>
244 #endif //#ifndef PCL_FILTERS_RANDOM_SUBSAMPLE_H_
std::string filter_name_
The filter name.
unsigned int seed_
Random number seed.
PointCloud::ConstPtr PointCloudConstPtr
RandomSample(bool extract_removed_indices=false)
Empty constructor.
unsigned int sample_
Number of indices that will be returned.
unsigned int getSeed()
Get the value of the internal seed parameter.
unsigned int seed_
Random number seed.
float unifRand()
Return a random number fast using a LCG (Linear Congruential Generator) algorithm.
void setSample(unsigned int sample)
Set number of indices to be sampled.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
FilterIndices represents the base class for filters that are about binary point removal.
RandomSample applies a random sampling with uniform probability.
boost::shared_ptr< RandomSample< pcl::PCLPointCloud2 > > Ptr
unsigned int getSample()
Get the value of the internal sample parameter.
PointCloud::Ptr PointCloudPtr
boost::shared_ptr< const RandomSample< PointT > > ConstPtr
void setSeed(unsigned int seed)
Set seed of random function.
void setSeed(unsigned int seed)
Set seed of random function.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > PCLPointCloud2ConstPtr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
boost::shared_ptr< ::pcl::PCLPointCloud2 > PCLPointCloud2Ptr
boost::shared_ptr< const RandomSample< pcl::PCLPointCloud2 > > ConstPtr
unsigned int getSample()
Get the value of the internal sample parameter.
unsigned int sample_
Number of indices that will be returned.
boost::shared_ptr< ::pcl::PCLPointCloud2 > Ptr
RandomSample()
Empty constructor.
A point structure representing Euclidean xyz coordinates, and the RGB color.
boost::shared_ptr< PointCloud< PointT > > Ptr
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void applyFilter(PointCloud &output)
Sample of point indices into a separate PointCloud.
boost::shared_ptr< RandomSample< PointT > > Ptr
unsigned int getSeed()
Get the value of the internal seed parameter.
float unifRand()
Return a random number fast using a LCG (Linear Congruential Generator) algorithm.
void setSample(unsigned int sample)
Set number of indices to be sampled.