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

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

typedef boost::shared_ptr
< UniformSampling< PointT > > 
Ptr
 
typedef boost::shared_ptr
< const UniformSampling
< PointT > > 
ConstPtr
 
- Public Types inherited from pcl::Filter< PointT >
typedef boost::shared_ptr
< Filter< PointT > > 
Ptr
 
typedef boost::shared_ptr
< const Filter< PointT > > 
ConstPtr
 
typedef pcl::PointCloud< PointTPointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
- Public Types inherited from pcl::PCLBase< PointT >
typedef pcl::PointCloud< PointTPointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
typedef boost::shared_ptr
< PointIndices
PointIndicesPtr
 
typedef boost::shared_ptr
< PointIndices const > 
PointIndicesConstPtr
 

Public Member Functions

 UniformSampling (bool extract_removed_indices=false)
 Empty constructor. More...
 
virtual ~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...
 
virtual ~Filter ()
 Empty destructor. More...
 
IndicesConstPtr const getRemovedIndices ()
 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 (size_t row_start, size_t col_start, size_t nb_rows, 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[] (size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Protected Member Functions

void applyFilter (PointCloud &output)
 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

boost::unordered_map< 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 their centroid. This approach is a bit slower than approximating them with the center of the voxel, but it represents the underlying surface more accurately.

Author
Radu Bogdan Rusu

Definition at line 61 of file uniform_sampling.h.

Member Typedef Documentation

template<typename PointT >
typedef boost::shared_ptr<const UniformSampling<PointT> > pcl::UniformSampling< PointT >::ConstPtr

Definition at line 72 of file uniform_sampling.h.

template<typename PointT >
typedef boost::shared_ptr<UniformSampling<PointT> > pcl::UniformSampling< PointT >::Ptr

Definition at line 71 of file uniform_sampling.h.

Constructor & Destructor Documentation

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_.

template<typename PointT >
virtual pcl::UniformSampling< PointT >::~UniformSampling ( )
inlinevirtual

Destructor.

Definition at line 90 of file uniform_sampling.h.

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

Member Function Documentation

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

Downsample a Point Cloud using a voxelized grid approach.

Parameters
[out]outputthe resultant point cloud message

Implements pcl::Filter< PointT >.

Definition at line 46 of file uniform_sampling.hpp.

References pcl::PointCloud< T >::height, pcl::UniformSampling< PointT >::Leaf::idx, pcl::PointCloud< T >::is_dense, pcl::PointCloud< T >::points, and pcl::PointCloud< T >::width.

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

Set the 3D grid leaf size.

Parameters
radiusthe 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

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

Definition at line 128 of file uniform_sampling.h.

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

Definition at line 128 of file uniform_sampling.h.

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().

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().

template<typename PointT >
boost::unordered_map<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().

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

Definition at line 128 of file uniform_sampling.h.

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.

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: