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

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

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

Inheritance diagram for pcl::ApproximateVoxelGrid< PointT >:

## Public Types

using | Ptr = shared_ptr<ApproximateVoxelGrid<PointT> >
using | ConstPtr = shared_ptr<const ApproximateVoxelGrid<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

| ApproximateVoxelGrid ()
| Empty constructor.
| ApproximateVoxelGrid (const ApproximateVoxelGrid &src)
| Copy constructor.
| ~ApproximateVoxelGrid () override
| Destructor.
ApproximateVoxelGrid & | operator= (const ApproximateVoxelGrid &src)
| Copy operator.
void | setLeafSize (const Eigen::Vector3f &leaf_size)
| Set the voxel grid leaf size.
void | setLeafSize (float lx, float ly, float lz)
| Set the voxel grid leaf size.
Eigen::Vector3f | getLeafSize () const
| Get the voxel grid leaf size.
void | setDownsampleAllData (bool downsample)
| Set to true if all fields need to be downsampled, or false if just XYZ.
bool | getDownsampleAllData () const
| Get the state of the internal downsampling parameter (true if all fields need to be downsampled, false if just XYZ).
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 Types

using | FieldList = typename pcl::traits::fieldList<PointT>::type

## Protected Member Functions

void | applyFilter (PointCloud &output) override
| Downsample a Point Cloud using a voxelized grid approach.
void | flush (PointCloud &output, std::size_t op, he *hhe, int rgba_index, int centroid_size)
| Write a single point from the hash to the output cloud.
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

Eigen::Vector3f | leaf_size_
| The size of a leaf.
Eigen::Array3f | inverse_leaf_size_
| Compute 1/leaf_size_ to avoid division later.
bool | downsample_all_data_ {true}
| Set to true if all fields need to be downsampled, or false if just XYZ.
std::size_t | histsize_ {512}
| history buffer size, power of 2
struct he * | history_
| history buffer
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::ApproximateVoxelGrid< PointT >

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

Thus, this is similar to the VoxelGrid filter. This class works best if points that are stored in memory next to each other (in the input point cloud), are also somewhat close in 3D euclidean space (this is for example usually the case for organized point clouds). If the points have no storage order (e.g. in synthetic, randomly generated point clouds), this class will give very poor results, and VoxelGrid should be used instead.

See also
  VoxelGrid

Author
  James Bowman, Radu B. Rusu

Definition at line 100 of file approximate_voxel_grid.h.

## Member Typedef Documentation

## ConstPtr

template<typename PointT>

using pcl::ApproximateVoxelGrid< PointT >::ConstPtr = shared_ptr<const ApproximateVoxelGrid<PointT> >

Definition at line 123 of file approximate_voxel_grid.h.

## FieldList

template<typename PointT>

using pcl::ApproximateVoxelGrid< PointT >::FieldList = typename pcl::traits::fieldList<PointT>::type

protected

Definition at line 231 of file approximate_voxel_grid.h.

## Ptr

template<typename PointT>

using pcl::ApproximateVoxelGrid< PointT >::Ptr = shared_ptr<ApproximateVoxelGrid<PointT> >

Definition at line 122 of file approximate_voxel_grid.h.

## Constructor & Destructor Documentation

## ApproximateVoxelGrid() [1/2]

template<typename PointT>

pcl::ApproximateVoxelGrid< PointT >::ApproximateVoxelGrid | ( |  | ) |

inline

Empty constructor.

Definition at line 127 of file approximate_voxel_grid.h.

References pcl::Filter< PointT >::Filter(), pcl::Filter< PointT >::filter_name_, history_, histsize_, inverse_leaf_size_, and leaf_size_.

Referenced by ApproximateVoxelGrid(), and operator=().

## ApproximateVoxelGrid() [2/2]

template<typename PointT>

pcl::ApproximateVoxelGrid< PointT >::ApproximateVoxelGrid | ( | const ApproximateVoxelGrid< PointT > & | src | ) |

inline

Copy constructor.

Parameters

  [in] | src | the approximate voxel grid to copy into this.

Definition at line 140 of file approximate_voxel_grid.h.

References ApproximateVoxelGrid(), downsample_all_data_, pcl::Filter< PointT >::Filter(), history_, histsize_, inverse_leaf_size_, and leaf_size_.

## ~ApproximateVoxelGrid()

template<typename PointT>

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

inline override

Destructor.

Definition at line 156 of file approximate_voxel_grid.h.

References history_.

## Member Function Documentation

## applyFilter()

template<typename PointT>

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

override protected virtual

Downsample a Point Cloud using a voxelized grid approach.

Parameters

  output | the resultant point cloud message

Implements pcl::Filter< PointT >.

Definition at line 66 of file approximate_voxel_grid.hpp.

References downsample_all_data_, flush(), pcl::for_each_type(), pcl::getFieldIndex(), history_, histsize_, pcl::PCLBase< PointT >::input_, inverse_leaf_size_, and pcl::isXYZFinite().

## flush()

template<typename PointT>

void pcl::ApproximateVoxelGrid< PointT >::flush | ( | PointCloud & | output,
|  | std::size_t | op,
|  | he * | hhe,
|  | int | rgba_index,
|  | int | centroid_size )

protected

Write a single point from the hash to the output cloud.

Definition at line 48 of file approximate_voxel_grid.hpp.

References pcl::for_each_type().

Referenced by applyFilter().

## getDownsampleAllData()

template<typename PointT>

bool pcl::ApproximateVoxelGrid< PointT >::getDownsampleAllData | ( |  | ) | const

inline

Get the state of the internal downsampling parameter (true if all fields need to be downsampled, false if just XYZ).

Definition at line 213 of file approximate_voxel_grid.h.

References downsample_all_data_.

## getLeafSize()

template<typename PointT>

Eigen::Vector3f pcl::ApproximateVoxelGrid< PointT >::getLeafSize | ( |  | ) | const

inline

Get the voxel grid leaf size.

Definition at line 201 of file approximate_voxel_grid.h.

References leaf_size_.

## operator=()

template<typename PointT>

ApproximateVoxelGrid & pcl::ApproximateVoxelGrid< PointT >::operator= | ( | const ApproximateVoxelGrid< PointT > & | src | ) |

inline

Copy operator.

Parameters

  [in] | src | the approximate voxel grid to copy into this.

Definition at line 166 of file approximate_voxel_grid.h.

References ApproximateVoxelGrid(), downsample_all_data_, history_, histsize_, inverse_leaf_size_, and leaf_size_.

## setDownsampleAllData()

template<typename PointT>

void pcl::ApproximateVoxelGrid< PointT >::setDownsampleAllData | ( | bool | downsample | ) |

inline

Set to true if all fields need to be downsampled, or false if just XYZ.

Parameters

  downsample | the new value (true/false)

Definition at line 207 of file approximate_voxel_grid.h.

References downsample_all_data_.

## setLeafSize() [1/2]

template<typename PointT>

void pcl::ApproximateVoxelGrid< PointT >::setLeafSize | ( | const Eigen::Vector3f & | leaf_size | ) |

inline

Set the voxel grid leaf size.

Parameters

  [in] | leaf_size | the voxel grid leaf size

Definition at line 182 of file approximate_voxel_grid.h.

References inverse_leaf_size_, and leaf_size_.

Referenced by setLeafSize().

## setLeafSize() [2/2]

template<typename PointT>

void pcl::ApproximateVoxelGrid< PointT >::setLeafSize | ( | float | lx,
|  | float | ly,
|  | float | lz )

inline

Set the voxel grid leaf size.

Parameters

  [in] | lx | the leaf size for X
  [in] | ly | the leaf size for Y
  [in] | lz | the leaf size for Z

Definition at line 194 of file approximate_voxel_grid.h.

References setLeafSize().

## Member Data Documentation

## downsample_all_data_

template<typename PointT>

bool pcl::ApproximateVoxelGrid< PointT >::downsample_all_data_ {true}

protected

Set to true if all fields need to be downsampled, or false if just XYZ.

Definition at line 223 of file approximate_voxel_grid.h.

Referenced by applyFilter(), ApproximateVoxelGrid(), getDownsampleAllData(), operator=(), and setDownsampleAllData().

## history_

template<typename PointT>

struct he* pcl::ApproximateVoxelGrid< PointT >::history_

protected

history buffer

Definition at line 229 of file approximate_voxel_grid.h.

Referenced by applyFilter(), ApproximateVoxelGrid(), ApproximateVoxelGrid(), operator=(), and ~ApproximateVoxelGrid().

## histsize_

template<typename PointT>

std::size_t pcl::ApproximateVoxelGrid< PointT >::histsize_ {512}

protected

history buffer size, power of 2

Definition at line 226 of file approximate_voxel_grid.h.

Referenced by applyFilter(), ApproximateVoxelGrid(), ApproximateVoxelGrid(), and operator=().

## inverse_leaf_size_

template<typename PointT>

Eigen::Array3f pcl::ApproximateVoxelGrid< PointT >::inverse_leaf_size_

protected

Compute 1/leaf_size_ to avoid division later.

Definition at line 220 of file approximate_voxel_grid.h.

Referenced by applyFilter(), ApproximateVoxelGrid(), ApproximateVoxelGrid(), operator=(), and setLeafSize().

## leaf_size_

template<typename PointT>

Eigen::Vector3f pcl::ApproximateVoxelGrid< PointT >::leaf_size_

protected

The size of a leaf.

Definition at line 217 of file approximate_voxel_grid.h.

Referenced by ApproximateVoxelGrid(), ApproximateVoxelGrid(), getLeafSize(), operator=(), and setLeafSize().

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

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