38#ifndef PCL_FILTERS_UNIFORM_SAMPLING_IMPL_H_
39#define PCL_FILTERS_UNIFORM_SAMPLING_IMPL_H_
42#include <pcl/filters/uniform_sampling.h>
43#include <pcl/common/point_tests.h>
46template <
typename Po
intT>
void
55 Eigen::Vector4f min_p, max_p;
86 (*removed_indices_)[rii++] = cp;
91 Eigen::Vector4i ijk = Eigen::Vector4i::Zero ();
111 Eigen::Vector4f voxel_center = (ijk.cast<
float>() + Eigen::Vector4f::Constant(0.5)) *
search_radius_;
114 float diff_cur = ((*input_)[cp].getVector4fMap () - voxel_center).squaredNorm ();
115 float diff_prev = ((*input_)[leaf.
idx].getVector4fMap () - voxel_center).squaredNorm ();
118 if (diff_cur < diff_prev)
121 (*removed_indices_)[rii++] = leaf.
idx;
127 (*removed_indices_)[rii++] = cp;
133 indices.resize (
leaves_.size ());
134 for (
const auto& leaf :
leaves_)
137 indices[oii++] = leaf.second.idx;
140 indices.resize (oii);
146#define PCL_INSTANTIATE_UniformSampling(T) template class PCL_EXPORTS pcl::UniformSampling<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.
PointCloudConstPtr input_
The input point cloud dataset.
IndicesPtr indices_
A pointer to the vector of point indices to use.
Define standard C methods and C++ classes that are common to all methods.
void getMinMax3D(const pcl::PointCloud< PointT > &cloud, PointT &min_pt, PointT &max_pt)
Get the minimum and maximum values on each of the 3 (x-y-z) dimensions in a given pointcloud.
IndicesAllocator<> Indices
Type used for indices in PCL.
constexpr bool isXYZFinite(const PointT &) noexcept