64 std::minstd_rand randomNumberGenerator;
67 std::random_device randomDevice;
68 randomNumberGenerator = std::minstd_rand(randomDevice());
72 randomNumberGenerator = std::minstd_rand(
seed);
79 const float randomNumberRange{
static_cast<float>(randomNumberGenerator.max() - randomNumberGenerator.min())};
80 return Eigen::VectorXf::NullaryExpr(nbPoints, [&](
float){
return static_cast<float>(randomNumberGenerator() / randomNumberRange);});
84 std::uniform_real_distribution<float> distribution(0, 1);
85 return Eigen::VectorXf::NullaryExpr(nbPoints, [&](
float){
return distribution(randomNumberGenerator);});
95 const size_t nbPointsIn = cloud.
features.cols();
96 const size_t nbPointsOut = nbPointsIn *
prob;
100 for (
size_t i{0u}; i < nbPointsIn && j<=nbPointsOut; ++i)
102 if (randomNumbers(i) < prob)
const int randomSamplingMethod
void setColFrom(Index thisCol, const DataPoints &that, Index thatCol)
Set column thisCol equal to column thatCol of that, copy features and descriptors if any...
virtual DataPoints filter(const DataPoints &input)
Apply filters to input point cloud. This is the non-destructive version and returns a copy...
Eigen::VectorXf sampleRandomIndices(const size_t nbPoints)
Functions and classes that are dependant on scalar type are defined in this templatized class...
const M::mapped_type & get(const M &m, const typename M::key_type &k)
The superclass of classes that are constructed using generic parameters. This class provides the para...
void conservativeResize(Index pointCount)
Resize the cloud to pointCount points, conserving existing ones.
RandomSamplingDataPointsFilter(const Parameters ¶ms=Parameters())
virtual void inPlaceFilter(DataPoints &cloud)
Apply these filters to a point cloud without copying.
Matrix features
features of points in the cloud
PM::DataPointsFilter DataPointsFilter
Parametrizable::Parameters Parameters