38#ifndef PCL_FILTERS_UNIFORM_SAMPLING_IMPL_H_
39#define PCL_FILTERS_UNIFORM_SAMPLING_IMPL_H_
42#include <pcl/filters/uniform_sampling.h>
45template <
typename Po
intT>
void
51 PCL_WARN (
"[pcl::%s::detectKeypoints] No input dataset given!\n",
getClassName ().c_str ());
52 output.width = output.height = 0;
58 output.is_dense =
true;
60 Eigen::Vector4f min_p, max_p;
84 for (std::size_t cp = 0; cp <
indices_->size (); ++cp)
99 Eigen::Vector4i ijk = Eigen::Vector4i::Zero ();
110 leaf.
idx = (*indices_)[cp];
115 float diff_cur = ((*input_)[(*indices_)[cp]].getVector4fMap () - ijk.cast<
float> ()).squaredNorm ();
116 float diff_prev = ((*input_)[leaf.
idx].getVector4fMap () - ijk.cast<
float> ()).squaredNorm ();
119 if (diff_cur < diff_prev)
123 leaf.
idx = (*indices_)[cp];
133 output.resize (
leaves_.size ());
136 for (
const auto& leaf :
leaves_)
137 output[cp++] = (*input_)[leaf.second.idx];
138 output.width = output.size ();
141#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.
const std::string & getClassName() const
Get a string representation of the name of this class.
IndicesPtr removed_indices_
Indices of the points that are removed.
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.