point_cloud_library / 1.12.1 / classpcl_1_1_uniform_sampling.html /

UniformSampling assembles a local 3D grid over a given PointCloud, and downsamples + filters the data. More...

#include <pcl/filters/uniform_sampling.h>

Classes

struct Leaf
Simple structure to hold an nD centroid and the number of points in a leaf. More...

Public Types

using Ptr = shared_ptr< UniformSampling< PointT > >
using ConstPtr = shared_ptr< const UniformSampling< PointT > >
- Public Types inherited from pcl::Filter< PointT >
using Ptr = shared_ptr< Filter< PointT > >
using ConstPtr = shared_ptr< const Filter< PointT > >
using PointCloud = pcl::PointCloud< PointT >
using PointCloudPtr = typename PointCloud::Ptr
using PointCloudConstPtr = typename PointCloud::ConstPtr
- Public Types inherited from pcl::PCLBase< PointT >
using PointCloud = pcl::PointCloud< PointT >
using PointCloudPtr = typename PointCloud::Ptr
using PointCloudConstPtr = typename PointCloud::ConstPtr
using PointIndicesPtr = PointIndices::Ptr
using PointIndicesConstPtr = PointIndices::ConstPtr

Public Member Functions

UniformSampling (bool extract_removed_indices=false)
Empty constructor. More...
~UniformSampling ()
Destructor. More...
virtual void setRadiusSearch (double radius)
Set the 3D grid leaf size. More...
- Public Member Functions inherited from pcl::Filter< PointT >
Filter (bool extract_removed_indices=false)
Empty constructor. More...
const IndicesConstPtr getRemovedIndices () const
Get the point indices being removed. More...
void getRemovedIndices (PointIndices &pi)
Get the point indices being removed. More...
void filter (PointCloud &output)
Calls the filtering method and returns the filtered dataset in output. More...
- Public Member Functions inherited from pcl::PCLBase< PointT >
PCLBase ()
Empty constructor. More...
PCLBase (const PCLBase &base)
Copy constructor. More...
virtual ~PCLBase ()=default
Destructor. More...
virtual void setInputCloud (const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset. More...
const PointCloudConstPtr getInputCloud () const
Get a pointer to the input point cloud dataset. More...
virtual void setIndices (const IndicesPtr &indices)
Provide a pointer to the vector of indices that represents the input data. More...
virtual void setIndices (const IndicesConstPtr &indices)
Provide a pointer to the vector of indices that represents the input data. More...
virtual void setIndices (const PointIndicesConstPtr &indices)
Provide a pointer to the vector of indices that represents the input data. More...
virtual void setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols)
Set the indices for the points laying within an interest region of the point cloud. More...
IndicesPtr getIndices ()
Get a pointer to the vector of indices used. More...
const IndicesConstPtr getIndices () const
Get a pointer to the vector of indices used. More...
const PointT & operator[] (std::size_t pos) const
Override PointCloud operator[] to shorten code. More...

Protected Member Functions

void applyFilter (PointCloud &output) override
Downsample a Point Cloud using a voxelized grid approach. More...
- Protected Member Functions inherited from pcl::Filter< PointT >
const std::string & getClassName () const
Get a string representation of the name of this class. More...
- Protected Member Functions inherited from pcl::PCLBase< PointT >
bool initCompute ()
This method should get called before starting the actual computation. More...
bool deinitCompute ()
This method should get called after finishing the actual computation. More...

Protected Attributes

std::unordered_map< std::size_t, Leaf > leaves_
The 3D grid leaves. More...
Eigen::Vector4f leaf_size_
The size of a leaf. More...
Eigen::Array4f inverse_leaf_size_
Internal leaf sizes stored as 1/leaf_size_ for efficiency reasons. More...
Eigen::Vector4i min_b_
The minimum and maximum bin coordinates, the number of divisions, and the division multiplier. More...
Eigen::Vector4i max_b_
Eigen::Vector4i div_b_
Eigen::Vector4i divb_mul_
double search_radius_
The nearest neighbors search radius for each point. More...
- Protected Attributes inherited from pcl::Filter< PointT >
IndicesPtr removed_indices_
Indices of the points that are removed. More...
std::string filter_name_
The filter name. More...
bool extract_removed_indices_
Set to true if we want to return the indices of the removed points. More...
- Protected Attributes inherited from pcl::PCLBase< PointT >
PointCloudConstPtr input_
The input point cloud dataset. More...
IndicesPtr indices_
A pointer to the vector of point indices to use. More...
bool use_indices_
Set to true if point indices are used. More...
bool fake_indices_
If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More...

Detailed Description

template<typename PointT>
class pcl::UniformSampling< PointT >

UniformSampling assembles a local 3D grid over a given PointCloud, and downsamples + filters the data.

The UniformSampling class creates a 3D voxel grid (think about a voxel grid as a set of tiny 3D boxes in space) over the input point cloud data. Then, in each voxel (i.e., 3D box), all the points present will be approximated (i.e., downsampled) with the closest point to the center of the voxel.

Author
Radu Bogdan Rusu

Definition at line 59 of file uniform_sampling.h.

Member Typedef Documentation

ConstPtr

template<typename PointT >
using pcl::UniformSampling< PointT >::ConstPtr = shared_ptr<const UniformSampling<PointT> >

Definition at line 72 of file uniform_sampling.h.

Ptr

template<typename PointT >
using pcl::UniformSampling< PointT >::Ptr = shared_ptr<UniformSampling<PointT> >

Definition at line 71 of file uniform_sampling.h.

Constructor & Destructor Documentation

UniformSampling()

template<typename PointT >
pcl::UniformSampling< PointT >::UniformSampling ( bool extract_removed_indices = false )
inline

Empty constructor.

Definition at line 75 of file uniform_sampling.h.

References pcl::Filter< PointT >::filter_name_.

~UniformSampling()

template<typename PointT >
pcl::UniformSampling< PointT >::~UniformSampling ( )
inline

Destructor.

Definition at line 90 of file uniform_sampling.h.

References pcl::UniformSampling< PointT >::leaves_.

Member Function Documentation

applyFilter()

template<typename PointT >
void pcl::UniformSampling< PointT >::applyFilter ( PointCloud & output )
overrideprotectedvirtual

setRadiusSearch()

template<typename PointT >
virtual void pcl::UniformSampling< PointT >::setRadiusSearch ( double radius )
inlinevirtual

Set the 3D grid leaf size.

Parameters
radius the 3D grid leaf size

Definition at line 99 of file uniform_sampling.h.

References pcl::UniformSampling< PointT >::inverse_leaf_size_, pcl::UniformSampling< PointT >::leaf_size_, and pcl::UniformSampling< PointT >::search_radius_.

Member Data Documentation

div_b_

template<typename PointT >
Eigen::Vector4i pcl::UniformSampling< PointT >::div_b_
protected

Definition at line 128 of file uniform_sampling.h.

divb_mul_

template<typename PointT >
Eigen::Vector4i pcl::UniformSampling< PointT >::divb_mul_
protected

Definition at line 128 of file uniform_sampling.h.

inverse_leaf_size_

template<typename PointT >
Eigen::Array4f pcl::UniformSampling< PointT >::inverse_leaf_size_
protected

Internal leaf sizes stored as 1/leaf_size_ for efficiency reasons.

Definition at line 125 of file uniform_sampling.h.

Referenced by pcl::UniformSampling< PointT >::setRadiusSearch().

leaf_size_

template<typename PointT >
Eigen::Vector4f pcl::UniformSampling< PointT >::leaf_size_
protected

The size of a leaf.

Definition at line 122 of file uniform_sampling.h.

Referenced by pcl::UniformSampling< PointT >::setRadiusSearch().

leaves_

template<typename PointT >
std::unordered_map<std::size_t, Leaf> pcl::UniformSampling< PointT >::leaves_
protected

The 3D grid leaves.

Definition at line 119 of file uniform_sampling.h.

Referenced by pcl::UniformSampling< PointT >::~UniformSampling().

max_b_

template<typename PointT >
Eigen::Vector4i pcl::UniformSampling< PointT >::max_b_
protected

Definition at line 128 of file uniform_sampling.h.

min_b_

template<typename PointT >
Eigen::Vector4i pcl::UniformSampling< PointT >::min_b_
protected

The minimum and maximum bin coordinates, the number of divisions, and the division multiplier.

Definition at line 128 of file uniform_sampling.h.

search_radius_

template<typename PointT >
double pcl::UniformSampling< PointT >::search_radius_
protected

The nearest neighbors search radius for each point.

Definition at line 131 of file uniform_sampling.h.

Referenced by pcl::UniformSampling< PointT >::setRadiusSearch().


The documentation for this class was generated from the following files:

© 2009–2012, Willow Garage, Inc.
© 2012–, Open Perception, Inc.
Licensed under the BSD License.
https://pointclouds.org/documentation/classpcl_1_1_uniform_sampling.html