pcl::UniformSampling< PointInT > Class Template Reference
Module keypoints

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

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

Inheritance diagram for pcl::UniformSampling< PointInT >:

## 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< PointInT > > | Ptr
typedef boost::shared_ptr< const UniformSampling< PointInT > > | ConstPtr
Public Types inherited from pcl::Keypoint< PointInT, int >
typedef boost::shared_ptr< Keypoint< PointInT, int > > | Ptr
typedef boost::shared_ptr< const Keypoint< PointInT, int > > | ConstPtr
typedef PCLBase< PointInT > | BaseClass
typedef pcl::search::Search< PointInT > | KdTree
typedef pcl::search::Search< PointInT >::Ptr | KdTreePtr
typedef pcl::PointCloud< PointInT > | PointCloudIn
typedef PointCloudIn::Ptr | PointCloudInPtr
typedef PointCloudIn::ConstPtr | PointCloudInConstPtr
typedef pcl::PointCloud< int > | PointCloudOut
typedef boost::function< int(int, double, std::vector< int > &, std::vector< float > &)> | SearchMethod
typedef boost::function< int(const PointCloudIn &cloud, int index, double, std::vector< int > &, std::vector< float > &)> | SearchMethodSurface
Public Types inherited from pcl::PCLBase< PointInT >
typedef pcl::PointCloud< PointInT > | PointCloud
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 ()
| 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::Keypoint< PointInT, int >
| Keypoint ()
| Empty constructor. More...
virtual | ~Keypoint ()
| Empty destructor. More...
virtual void | setSearchSurface (const PointCloudInConstPtr &cloud)
| Provide a pointer to the input dataset that we need to estimate features at every point for. More...
PointCloudInConstPtr | getSearchSurface ()
| Get a pointer to the surface point cloud dataset. More...
void | setSearchMethod (const KdTreePtr &tree)
| Provide a pointer to the search object. More...
KdTreePtr | getSearchMethod ()
| Get a pointer to the search method used. More...
double | getSearchParameter ()
| Get the internal search parameter. More...
void | setKSearch (int k)
| Set the number of k nearest neighbors to use for the feature estimation. More...
int | getKSearch ()
| get the number of k nearest neighbors used for the feature estimation. More...
void | setRadiusSearch (double radius)
| Set the sphere radius that is to be used for determining the nearest neighbors used for the key point detection. More...
double | getRadiusSearch ()
| Get the sphere radius used for determining the neighbors. More...
pcl::PointIndicesConstPtr | getKeypointsIndices ()
void | compute (PointCloudOut &output)
| Base method for key point detection for all points given in <setInputCloud (), setIndices ()> using the surface in setSearchSurface () and the spatial locator in setSearchMethod () More...
int | searchForNeighbors (int index, double parameter, std::vector< int > &indices, std::vector< float > &distances) const
| Search for k-nearest neighbors using the spatial locator from setSearchmethod, and the given surface from setSearchSurface. More...
Public Member Functions inherited from pcl::PCLBase< PointInT >
| 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 PointInT & | operator[] (size_t pos) const
| Override PointCloud operator[] to shorten code. More...

## Protected Member Functions

void | detectKeypoints (PointCloudOut &output)
| Downsample a Point Cloud using a voxelized grid approach. More...
Protected Member Functions inherited from pcl::Keypoint< PointInT, int >
virtual bool | initCompute ()
const std::string & | getClassName () const
| Get a string representation of the name of this class. More...
virtual void | detectKeypoints (PointCloudOut &output)=0
| Abstract key point detection method. More...
Protected Member Functions inherited from pcl::PCLBase< PointInT >
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_
Protected Attributes inherited from pcl::Keypoint< PointInT, int >
std::string | name_
| The key point detection method's name. More...
SearchMethod | search_method_
| The search method template for indices. More...
SearchMethodSurface | search_method_surface_
| The search method template for points. More...
PointCloudInConstPtr | surface_
| An input point cloud describing the surface that is to be used for nearest neighbors estimation. More...
KdTreePtr | tree_
| A pointer to the spatial search object. More...
double | search_parameter_
| The actual search parameter (casted from either search_radius_ or k_). More...
double | search_radius_
| The nearest neighbors search radius for each point. More...
int | k_
| The number of K nearest neighbors to use for each point. More...
pcl::PointIndicesPtr | keypoints_indices_
| Indices of the keypoints in the input cloud. More...
Protected Attributes inherited from pcl::PCLBase< PointInT >
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 PointInT>
class pcl::UniformSampling< PointInT >

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

typedef boost::shared_ptr<const UniformSampling<PointInT> > pcl::UniformSampling< PointInT >::ConstPtr

Definition at line 74 of file uniform_sampling.h.

template<typename PointInT >

typedef boost::shared_ptr<UniformSampling<PointInT> > pcl::UniformSampling< PointInT >::Ptr

Definition at line 73 of file uniform_sampling.h.

## Constructor & Destructor Documentation

template<typename PointInT >

pcl::UniformSampling< PointInT >::UniformSampling | ( |  | ) |

inline

Empty constructor.

Definition at line 77 of file uniform_sampling.h.

References pcl::Keypoint< PointInT, int >::name_.

template<typename PointInT >

virtual pcl::UniformSampling< PointInT >::~UniformSampling | ( |  | ) |

inline virtual

Destructor.

Definition at line 90 of file uniform_sampling.h.

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

## Member Function Documentation

template<typename PointInT >

void pcl::UniformSampling< PointInT >::detectKeypoints | ( | PointCloudOut & | output | ) |

protected

Downsample a Point Cloud using a voxelized grid approach.

Parameters

  output | the resultant point cloud message

Definition at line 46 of file uniform_sampling.hpp.

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

template<typename PointInT >

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

inline virtual

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< PointInT >::inverse_leaf_size_, pcl::UniformSampling< PointInT >::leaf_size_, and pcl::Keypoint< PointInT, int >::search_radius_.

## Member Data Documentation

template<typename PointInT >

Eigen::Vector4i pcl::UniformSampling< PointInT >::div_b_

protected

Definition at line 128 of file uniform_sampling.h.

template<typename PointInT >

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

protected

Definition at line 128 of file uniform_sampling.h.

template<typename PointInT >

Eigen::Array4f pcl::UniformSampling< PointInT >::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< PointInT >::setRadiusSearch().

template<typename PointInT >

Eigen::Vector4f pcl::UniformSampling< PointInT >::leaf_size_

protected

The size of a leaf.

Definition at line 122 of file uniform_sampling.h.

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

template<typename PointInT >

boost::unordered_map<size_t, Leaf> pcl::UniformSampling< PointInT >::leaves_

protected

The 3D grid leaves.

Definition at line 119 of file uniform_sampling.h.

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

template<typename PointInT >

Eigen::Vector4i pcl::UniformSampling< PointInT >::max_b_

protected

Definition at line 128 of file uniform_sampling.h.

template<typename PointInT >

Eigen::Vector4i pcl::UniformSampling< PointInT >::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.

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

- /build/pcl-0nnAvv/pcl-1.7.2/keypoints/include/pcl/keypoints/uniform_sampling.h
- /build/pcl-0nnAvv/pcl-1.7.2/keypoints/include/pcl/keypoints/impl/uniform_sampling.hpp