38#ifndef PCL_FILTERS_IMPL_NORMAL_SPACE_SAMPLE_H_
39#define PCL_FILTERS_IMPL_NORMAL_SPACE_SAMPLE_H_
41#include <pcl/filters/normal_space.h>
47template<
typename Po
intT,
typename NormalT>
bool
54 if (sample_ >= input_->size ())
56 PCL_ERROR (
"[NormalSpaceSampling::initCompute] Requested more samples than the input cloud size: %d vs %lu\n",
57 sample_, input_->size ());
66template<
typename Po
intT,
typename NormalT>
bool
80template<
typename Po
intT,
typename NormalT>
unsigned int
83 const unsigned ix =
static_cast<unsigned> (std::round (0.5f * (binsx_ - 1.f) * (normal[0] + 1.f)));
84 const unsigned iy =
static_cast<unsigned> (std::round (0.5f * (binsy_ - 1.f) * (normal[1] + 1.f)));
85 const unsigned iz =
static_cast<unsigned> (std::round (0.5f * (binsz_ - 1.f) * (normal[2] + 1.f)));
86 return ix * (binsy_*binsz_) + iy * binsz_ + iz;
90template<
typename Po
intT,
typename NormalT>
void
99 unsigned int max_values = (std::min) (sample_,
static_cast<unsigned int> (input_normals_->size ()));
105 unsigned int n_bins = binsx_ * binsy_ * binsz_;
110 for (
unsigned int i = 0; i <
n_bins; i++)
113 for (
const auto index : *indices_)
115 unsigned int bin_number = findBin ((*input_normals_)[index].normal);
155 unsigned int pos = 0;
181 if (extract_removed_indices_)
190 inserter (*removed_indices_, removed_indices_->begin ()));
194#define PCL_INSTANTIATE_NormalSpaceSampling(T,NT) template class PCL_EXPORTS pcl::NormalSpaceSampling<T,NT>;
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
FilterIndices represents the base class for filters that are about binary point removal.
NormalSpaceSampling samples the input point cloud in the space of normal directions computed at every...
void applyFilter(Indices &indices) override
Sample of point indices.
IndicesAllocator<> Indices
Type used for indices in PCL.