38#ifndef PCL_FILTERS_IMPL_SHADOW_POINTS_FILTER_H_
39#define PCL_FILTERS_IMPL_SHADOW_POINTS_FILTER_H_
41#include <pcl/filters/shadowpoints.h>
46template<
typename Po
intT,
typename NormalT>
void
50 output.resize (input_->size ());
51 if (extract_removed_indices_)
52 removed_indices_->resize (input_->size ());
56 for (std::size_t i = 0; i < input_->size (); i++)
58 const NormalT &normal = (*input_normals_)[i];
60 const float val = std::abs (normal.normal_x *
pt.x + normal.normal_y *
pt.y + normal.normal_z *
pt.z);
62 if ( (
val >= threshold_) ^ negative_)
66 if (extract_removed_indices_)
67 (*removed_indices_)[
ri++] = i;
77 removed_indices_->resize (
ri);
83template<
typename Po
intT,
typename NormalT>
void
87 indices.resize (input_->size ());
88 if (extract_removed_indices_)
89 removed_indices_->resize (indices_->size ());
93 for (
const auto& idx : (*indices_))
95 const NormalT &normal = (*input_normals_)[idx];
98 float val = std::abs (normal.normal_x *
pt.x + normal.normal_y *
pt.y + normal.normal_z *
pt.z);
100 if ( (
val >= threshold_) ^ negative_)
102 else if (extract_removed_indices_)
103 (*removed_indices_)[z++] = idx;
106 removed_indices_->resize (z);
109#define PCL_INSTANTIATE_ShadowPoints(T,NT) template class PCL_EXPORTS pcl::ShadowPoints<T,NT>;
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
std::size_t size() const
Size of the range the iterator is going through.
void applyFilter(PointCloud &output) override
Sample of point indices into a separate PointCloud.
IndicesAllocator<> Indices
Type used for indices in PCL.
A point structure representing normal coordinates and the surface curvature estimate.
A point structure representing Euclidean xyz coordinates, and the RGB color.