38#ifndef PCL_FILTERS_IMPL_RANDOM_SAMPLE_H_
39#define PCL_FILTERS_IMPL_RANDOM_SAMPLE_H_
41#include <pcl/filters/random_sample.h>
45template<
typename Po
intT>
61 indices.resize (sample_size);
67 srand_deterministic (
seed_);
74 std::size_t index = 0;
75 std::vector<bool> added;
77 added.resize (
indices_->size (),
false);
78 std::size_t n = sample_size;
89 indices[i++] = (*indices_)[index];
103 for (std::size_t i = 0; i < added.size (); i++)
107 (*removed_indices_)[ri++] = (*indices_)[i];
114#define PCL_INSTANTIATE_RandomSample(T) template class PCL_EXPORTS pcl::RandomSample<T>;
bool extract_removed_indices_
Set to true if we want to return the indices of the removed points.
IndicesPtr removed_indices_
Indices of the points that are removed.
bool negative_
False = normal filter behavior (default), true = inverted behavior.
IndicesPtr indices_
A pointer to the vector of point indices to use.
float unifRand()
Return a random number fast using a LCG (Linear Congruential Generator) algorithm.
void applyFilter(Indices &indices) override
Sample of point indices.
unsigned int sample_
Number of indices that will be returned.
unsigned int seed_
Random number seed.
IndicesAllocator<> Indices
Type used for indices in PCL.