40#include <pcl/filters/filter.h>
52 template<
typename Po
intT>
64 using Vector = Eigen::Matrix<float, Eigen::Dynamic, 1>;
68 using Ptr = shared_ptr<SamplingSurfaceNormal<PointT> >;
69 using ConstPtr = shared_ptr<const SamplingSurfaceNormal<PointT> >;
152 const pcl::PointCloud <PointT>& cloud;
155 CompareDim (
const int dim,
const pcl::PointCloud <PointT>& cloud) : dim (dim), cloud (cloud)
161 operator () (
const int& p0,
const int& p1)
164 return (cloud[p0].x < cloud[p1].x);
166 return (cloud[p0].y < cloud[p1].y);
168 return (cloud[p0].z < cloud[p1].z);
179 findXYZMaxMin (
const PointCloud& cloud, Vector& max_vec, Vector& min_vec);
192 partition (
const PointCloud& cloud,
const int first,
const int last,
193 const Vector min_values,
const Vector max_values,
204 samplePartition (
const PointCloud& data,
const int first,
const int last,
213 findCutVal (
const PointCloud& cloud,
const int cut_dim,
const int cut_index);
222 computeNormal (
const PointCloud& cloud, Eigen::Vector4f &normal,
float& curvature);
232 Eigen::Matrix3f &covariance_matrix,
233 Eigen::Vector4f ¢roid);
242 solvePlaneParameters (
const Eigen::Matrix3f &covariance_matrix,
243 float &nx,
float &ny,
float &nz,
float &curvature);
247#ifdef PCL_NO_PRECOMPILE
248#include <pcl/filters/impl/sampling_surface_normal.hpp>
Filter represents the base filter class.
const std::string & getClassName() const
Get a string representation of the name of this class.
std::string filter_name_
The filter name.
PointCloudConstPtr input_
The input point cloud dataset.
IndicesPtr indices_
A pointer to the vector of point indices to use.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
SamplingSurfaceNormal divides the input space into grids until each grid contains a maximum of N poin...
void setSample(unsigned int sample)
Set maximum number of samples in each grid.
shared_ptr< const SamplingSurfaceNormal< PointT > > ConstPtr
void setSeed(unsigned int seed)
Set seed of random function.
unsigned int getSample() const
Get the value of the internal sample parameter.
void setRatio(float ratio)
Set ratio of points to be sampled in each grid.
float getRatio() const
Get the value of the internal ratio parameter.
void applyFilter(PointCloud &output) override
Sample of point indices into a separate PointCloud.
SamplingSurfaceNormal()
Empty constructor.
float ratio_
Ratio of points to be sampled in each grid.
unsigned int getSeed() const
Get the value of the internal seed parameter.
unsigned int sample_
Maximum number of samples in each grid.
shared_ptr< SamplingSurfaceNormal< PointT > > Ptr
unsigned int seed_
Random number seed.
IndicesAllocator<> Indices
Type used for indices in PCL.
A point structure representing Euclidean xyz coordinates, and the RGB color.