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)));
239 #ifdef PCL_NO_PRECOMPILE 240 #include <pcl/filters/impl/random_sample.hpp> 243 #endif //#ifndef PCL_FILTERS_RANDOM_SUBSAMPLE_H_ PointCloud::ConstPtr PointCloudConstPtr
void setSample(unsigned int sample)
Set number of indices to be sampled.
unsigned int getSample()
Get the value of the internal sample parameter.
unsigned int getSeed()
Get the value of the internal seed parameter.
This file defines compatibility wrappers for low level I/O functions.
RandomSample(bool extract_removed_indices=false)
Empty constructor.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > PCLPointCloud2ConstPtr
unsigned int sample_
Number of indices that will be returned.
unsigned int seed_
Random number seed.
boost::shared_ptr< const RandomSample< PointT > > ConstPtr
boost::shared_ptr< ::pcl::PCLPointCloud2 > Ptr
boost::shared_ptr< PointCloud< PointT > > Ptr
FilterIndices represents the base class for filters that are about binary point removal.
PointCloud::Ptr PointCloudPtr
boost::shared_ptr< RandomSample< PointT > > Ptr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
void setSeed(unsigned int seed)
Set seed of random function.
float unifRand()
Return a random number fast using a LCG (Linear Congruential Generator) algorithm.
RandomSample()
Empty constructor.
boost::shared_ptr< ::pcl::PCLPointCloud2 > PCLPointCloud2Ptr
boost::shared_ptr< RandomSample< pcl::PCLPointCloud2 > > Ptr
unsigned int seed_
Random number seed.
unsigned int getSample()
Get the value of the internal sample parameter.
void applyFilter(PointCloud &output)
Sample of point indices into a separate PointCloud.
std::string filter_name_
The filter name.
float unifRand()
Return a random number fast using a LCG (Linear Congruential Generator) algorithm.
A point structure representing Euclidean xyz coordinates, and the RGB color.
unsigned int sample_
Number of indices that will be returned.
RandomSample applies a random sampling with uniform probability.
boost::shared_ptr< const RandomSample< pcl::PCLPointCloud2 > > ConstPtr
void setSample(unsigned int sample)
Set number of indices to be sampled.
unsigned int getSeed()
Get the value of the internal seed parameter.
void setSeed(unsigned int seed)
Set seed of random function.