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> >;
132 unsigned int seed_{
static_cast<unsigned int> (time (
nullptr))};
160 operator () (
const int& p0,
const int& p1)
163 return (cloud[p0].x < cloud[p1].x);
165 return (cloud[p0].y < cloud[p1].y);
167 return (cloud[p0].z < cloud[p1].z);
178 findXYZMaxMin (
const PointCloud& cloud, Vector& max_vec, Vector& min_vec);
191 partition (
const PointCloud& cloud,
const int first,
const int last,
192 const Vector min_values,
const Vector max_values,
203 samplePartition (
const PointCloud& data,
const int first,
const int last,
212 findCutVal (
const PointCloud& cloud,
const int cut_dim,
const int cut_index);
221 computeNormal (
const PointCloud& cloud, Eigen::Vector4f &normal,
float& curvature);
231 Eigen::Matrix3f &covariance_matrix,
232 Eigen::Vector4f ¢roid);
241 solvePlaneParameters (
const Eigen::Matrix3f &covariance_matrix,
242 float &nx,
float &ny,
float &nz,
float &curvature);
246 #ifdef PCL_NO_PRECOMPILE
247 #include <pcl/filters/impl/sampling_surface_normal.hpp>
Filter represents the base filter class.
shared_ptr< Filter< PointT > > Ptr
shared_ptr< const Filter< PointT > > ConstPtr
std::string filter_name_
The filter name.
typename PointCloud::Ptr PointCloudPtr
typename PointCloud::ConstPtr PointCloudConstPtr
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.
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.
unsigned int seed_
Random number seed.
IndicesAllocator<> Indices
Type used for indices in PCL.