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";
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_
unsigned int getSeed()
Get the value of the internal seed parameter.
boost::shared_ptr< ::pcl::PCLPointCloud2 > Ptr
unsigned int getSeed()
Get the value of the internal seed parameter.
PointCloud::Ptr PointCloudPtr
unsigned int sample_
Number of indices that will be returned.
unsigned int getSample()
Get the value of the internal sample parameter.
void setSeed(unsigned int seed)
Set seed of random function.
std::string filter_name_
The filter name.
unsigned int seed_
Random number seed.
void setSample(unsigned int sample)
Set number of indices to be sampled.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > PCLPointCloud2ConstPtr
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
unsigned int getSample()
Get the value of the internal sample parameter.
void setSeed(unsigned int seed)
Set seed of random function.
RandomSample applies a random sampling with uniform probability.
boost::shared_ptr< const RandomSample< PointT > > ConstPtr
unsigned int sample_
Number of indices that will be returned.
boost::shared_ptr< const RandomSample< pcl::PCLPointCloud2 > > ConstPtr
float unifRand()
Return a random number fast using a LCG (Linear Congruential Generator) algorithm.
unsigned int seed_
Random number seed.
FilterIndices represents the base class for filters that are about binary point removal.
void setSample(unsigned int sample)
Set number of indices to be sampled.
float unifRand()
Return a random number fast using a LCG (Linear Congruential Generator) algorithm.
boost::shared_ptr< PointCloud< PointT > > Ptr
RandomSample(bool extract_removed_indices=false)
Empty constructor.
boost::shared_ptr< RandomSample< pcl::PCLPointCloud2 > > Ptr
boost::shared_ptr< ::pcl::PCLPointCloud2 > PCLPointCloud2Ptr
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
void applyFilter(PointCloud &output)
Sample of point indices into a separate PointCloud.
RandomSample()
Empty constructor.
A point structure representing Euclidean xyz coordinates, and the RGB color.
boost::shared_ptr< RandomSample< PointT > > Ptr