Loading...
Searching...
No Matches
pcl::UniformSampling< PointT > Class Template Reference
Module filters

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

`#include <pcl/filters/uniform_sampling.h>`

Inheritance diagram for pcl::UniformSampling< PointT >:

## 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

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

## Protected Member Functions

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

## Protected Attributes

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

## 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_MAKE_ALIGNED_OPERATOR_NEW pcl::UniformSampling< PointT >::UniformSampling | ( | bool | extract_removed_indices = `false` | ) |

inline

Empty constructor.

Definition at line 77 of file uniform_sampling.h.

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

## ~UniformSampling()

template<typename PointT >

pcl::UniformSampling< PointT >::~UniformSampling | ( |  | ) |

inline override

Destructor.

Definition at line 91 of file uniform_sampling.h.

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

## Member Function Documentation

## applyFilter()

template<typename PointT >

void pcl::UniformSampling< PointT >::applyFilter | ( | PointCloud & | output | ) |

override protected virtual

Downsample a Point Cloud using a voxelized grid approach.

Parameters

  [out] | output | the resultant point cloud message

Implements pcl::Filter< PointT >.

Definition at line 46 of file uniform_sampling.hpp.

References pcl::UniformSampling< PointT >::Leaf::idx.

## setRadiusSearch()

template<typename PointT >

virtual void pcl::UniformSampling< PointT >::setRadiusSearch | ( | double | radius | ) |

inline virtual

Set the 3D grid leaf size.

Parameters

  radius | the 3D grid leaf size

Definition at line 100 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 129 of file uniform_sampling.h.

## divb_mul_

template<typename PointT >

Eigen::Vector4i pcl::UniformSampling< PointT >::divb_mul_

protected

Definition at line 129 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 126 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 123 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 120 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 129 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 129 of file uniform_sampling.h.

## search_radius_

template<typename PointT >

double pcl::UniformSampling< PointT >::search_radius_ {0.0}

protected

The nearest neighbors search radius for each point.

Definition at line 132 of file uniform_sampling.h.

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

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

- pcl/filters/uniform_sampling.h
- pcl/filters/impl/uniform_sampling.hpp