Point Cloud Library (PCL)  1.9.1-dev
List of all members | Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
pcl::ApproximateVoxelGrid< PointT > Class Template Reference

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 = boost::shared_ptr< ApproximateVoxelGrid< PointT > >
 
using ConstPtr = boost::shared_ptr< const ApproximateVoxelGrid< PointT > >
 
- Public Types inherited from pcl::Filter< PointT >
using Ptr = boost::shared_ptr< Filter< PointT > >
 
using ConstPtr = boost::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 = boost::shared_ptr< PointIndices >
 
using PointIndicesConstPtr = boost::shared_ptr< PointIndices const >
 

Public Member Functions

 ApproximateVoxelGrid ()
 Empty constructor. More...
 
 ApproximateVoxelGrid (const ApproximateVoxelGrid &src)
 Copy constructor. More...
 
 ~ApproximateVoxelGrid ()
 Destructor. More...
 
ApproximateVoxelGridoperator= (const ApproximateVoxelGrid &src)
 Copy operator. More...
 
void setLeafSize (const Eigen::Vector3f &leaf_size)
 Set the voxel grid leaf size. More...
 
void setLeafSize (float lx, float ly, float lz)
 Set the voxel grid leaf size. More...
 
Eigen::Vector3f getLeafSize () const
 Get the voxel grid leaf size. More...
 
void setDownsampleAllData (bool downsample)
 Set to true if all fields need to be downsampled, or false if just XYZ. More...
 
bool getDownsampleAllData () const
 Get the state of the internal downsampling parameter (true if all fields need to be downsampled, false if just XYZ). More...
 
- Public Member Functions inherited from pcl::Filter< PointT >
 Filter (bool extract_removed_indices=false)
 Empty constructor. More...
 
 ~Filter ()
 Empty destructor. More...
 
IndicesConstPtr const 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 ()
 Destructor. More...
 
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset. More...
 
PointCloudConstPtr const 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 const getIndices ()
 Get a pointer to the vector of indices used. More...
 
IndicesConstPtr const getIndices () const
 Get a pointer to the vector of indices used. More...
 
const PointToperator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

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. More...
 
void flush (PointCloud &output, size_t op, he *hhe, int rgba_index, int centroid_size)
 Write a single point from the hash to the output cloud. 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

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

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

Author
James Bowman, Radu B. Rusu

Definition at line 99 of file approximate_voxel_grid.h.

Member Typedef Documentation

◆ ConstPtr

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

Definition at line 122 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 230 of file approximate_voxel_grid.h.

◆ Ptr

template<typename PointT >
using pcl::ApproximateVoxelGrid< PointT >::Ptr = boost::shared_ptr<ApproximateVoxelGrid<PointT> >

Definition at line 121 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 126 of file approximate_voxel_grid.h.

◆ ApproximateVoxelGrid() [2/2]

template<typename PointT >
pcl::ApproximateVoxelGrid< PointT >::ApproximateVoxelGrid ( const ApproximateVoxelGrid< PointT > &  src)
inline

Copy constructor.

Parameters
[in]srcthe approximate voxel grid to copy into this.

Definition at line 139 of file approximate_voxel_grid.h.

References pcl::ApproximateVoxelGrid< PointT >::history_.

◆ ~ApproximateVoxelGrid()

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

Destructor.

Definition at line 155 of file approximate_voxel_grid.h.

Member Function Documentation

◆ applyFilter()

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

Downsample a Point Cloud using a voxelized grid approach.

Parameters
outputthe resultant point cloud message

Implements pcl::Filter< PointT >.

Definition at line 65 of file approximate_voxel_grid.hpp.

References pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::is_dense, pcl::PointCloud< PointT >::points, and pcl::PointCloud< PointT >::width.

◆ flush()

template<typename PointT >
void pcl::ApproximateVoxelGrid< PointT >::flush ( PointCloud output,
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 47 of file approximate_voxel_grid.hpp.

References pcl::PointCloud< PointT >::points.

◆ 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 212 of file approximate_voxel_grid.h.

◆ getLeafSize()

template<typename PointT >
Eigen::Vector3f pcl::ApproximateVoxelGrid< PointT >::getLeafSize ( ) const
inline

Get the voxel grid leaf size.

Definition at line 200 of file approximate_voxel_grid.h.

◆ operator=()

template<typename PointT >
ApproximateVoxelGrid& pcl::ApproximateVoxelGrid< PointT >::operator= ( const ApproximateVoxelGrid< PointT > &  src)
inline

◆ 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
downsamplethe new value (true/false)

Definition at line 206 of file approximate_voxel_grid.h.

◆ 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_sizethe voxel grid leaf size

Definition at line 181 of file approximate_voxel_grid.h.

◆ 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]lxthe leaf size for X
[in]lythe leaf size for Y
[in]lzthe leaf size for Z

Definition at line 193 of file approximate_voxel_grid.h.

Member Data Documentation

◆ downsample_all_data_

template<typename PointT >
bool pcl::ApproximateVoxelGrid< PointT >::downsample_all_data_
protected

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

Definition at line 222 of file approximate_voxel_grid.h.

Referenced by pcl::ApproximateVoxelGrid< PointT >::operator=().

◆ history_

template<typename PointT >
struct he* pcl::ApproximateVoxelGrid< PointT >::history_
protected

◆ histsize_

template<typename PointT >
size_t pcl::ApproximateVoxelGrid< PointT >::histsize_
protected

history buffer size, power of 2

Definition at line 225 of file approximate_voxel_grid.h.

Referenced by pcl::ApproximateVoxelGrid< PointT >::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 219 of file approximate_voxel_grid.h.

Referenced by pcl::ApproximateVoxelGrid< PointT >::operator=().

◆ leaf_size_

template<typename PointT >
Eigen::Vector3f pcl::ApproximateVoxelGrid< PointT >::leaf_size_
protected

The size of a leaf.

Definition at line 216 of file approximate_voxel_grid.h.

Referenced by pcl::ApproximateVoxelGrid< PointT >::operator=().


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