Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions
pcl::PFHEstimation< PointInT, PointNT, PointOutT > Class Template Reference

PFHEstimation estimates the Point Feature Histogram (PFH) descriptor for a given point cloud dataset containing points and normals. More...

#include <pcl/features/pfh.h>

Inheritance diagram for pcl::PFHEstimation< PointInT, PointNT, PointOutT >:
Inheritance graph
[legend]
Collaboration diagram for pcl::PFHEstimation< PointInT, PointNT, PointOutT >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Feature< PointInT,
PointOutT >::PointCloudOut 
PointCloudOut
typedef Feature< PointInT,
PointOutT >::PointCloudIn 
PointCloudIn
typedef pcl::PointCloud< PointNT > PointCloudN
typedef PointCloudN::Ptr PointCloudNPtr
typedef PointCloudN::ConstPtr PointCloudNConstPtr
typedef boost::shared_ptr
< FeatureFromNormals< PointInT,
PointNT, PointOutT > > 
Ptr
typedef boost::shared_ptr
< const FeatureFromNormals
< PointInT, PointNT, PointOutT > > 
ConstPtr
typedef PCLBase< PointInT > BaseClass
typedef pcl::search::Search
< PointInT > 
KdTree
typedef pcl::search::Search
< PointInT >::Ptr 
KdTreePtr
typedef boost::function< int(size_t,
double, std::vector< int >
&, std::vector< float > &)> 
SearchMethod
typedef boost::function< int(const
PointCloudIn &cloud, size_t
index, double, std::vector
< int > &, std::vector< float > &)> 
SearchMethodSurface
typedef pcl::PointCloud< PointInT > PointCloud
typedef PointCloud::Ptr PointCloudPtr
typedef PointCloud::ConstPtr PointCloudConstPtr
typedef PointIndices::Ptr PointIndicesPtr
typedef PointIndices::ConstPtr PointIndicesConstPtr

Public Member Functions

 PFHEstimation ()
 Empty constructor.
void setMaximumCacheSize (unsigned int cache_size)
 Set the maximum internal cache size.
unsigned int getMaximumCacheSize ()
 Get the maximum internal cache size.
void setUseInternalCache (bool use_cache)
 Set whether to use an internal cache mechanism for removing redundant calculations or not.
bool getUseInternalCache ()
 Get whether the internal cache is used or not for computing the PFH features.
bool computePairFeatures (const pcl::PointCloud< PointInT > &cloud, const pcl::PointCloud< PointNT > &normals, int p_idx, int q_idx, float &f1, float &f2, float &f3, float &f4)
 Compute the 4-tuple representation containing the three angles and one distance between two points represented by Cartesian coordinates and normals.
void computePointPFHSignature (const pcl::PointCloud< PointInT > &cloud, const pcl::PointCloud< PointNT > &normals, const std::vector< int > &indices, int nr_split, Eigen::VectorXf &pfh_histogram)
 Estimate the PFH (Point Feature Histograms) individual signatures of the three angular (f1, f2, f3) features for a given point based on its spatial neighborhood of 3D points with normals.
void setInputNormals (const PointCloudNConstPtr &normals)
 Provide a pointer to the input dataset that contains the point normals of the XYZ dataset.
PointCloudNConstPtr getInputNormals () const
 Get a pointer to the normals of the input XYZ point cloud dataset.
void setSearchSurface (const PointCloudInConstPtr &cloud)
 Provide a pointer to a dataset to add additional information to estimate the features for every point in the input dataset.
PointCloudInConstPtr getSearchSurface () const
 Get a pointer to the surface point cloud dataset.
void setSearchMethod (const KdTreePtr &tree)
 Provide a pointer to the search object.
KdTreePtr getSearchMethod () const
 Get a pointer to the search method used.
double getSearchParameter () const
 Get the internal search parameter.
void setKSearch (int k)
 Set the number of k nearest neighbors to use for the feature estimation.
int getKSearch () const
 get the number of k nearest neighbors used for the feature estimation.
void setRadiusSearch (double radius)
 Set the sphere radius that is to be used for determining the nearest neighbors used for the feature estimation.
double getRadiusSearch () const
 Get the sphere radius used for determining the neighbors.
void compute (PointCloudOut &output)
 Base method for feature estimation for all points given in <setInputCloud (), setIndices ()> using the surface in setSearchSurface () and the spatial locator in setSearchMethod ()
void computeEigen (pcl::PointCloud< Eigen::MatrixXf > &output)
 Base method for feature estimation for all points given in <setInputCloud (), setIndices ()> using the surface in setSearchSurface () and the spatial locator in setSearchMethod ()
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset.
PointCloudConstPtr const getInputCloud ()
 Get a pointer to the input point cloud dataset.
void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data.
void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data.
void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data.
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.
IndicesPtr const getIndices ()
 Get a pointer to the vector of indices used.
const PointInT & operator[] (size_t pos)
 Override PointCloud operator[] to shorten code.

Detailed Description

template<typename PointInT, typename PointNT, typename PointOutT = pcl::PFHSignature125>
class pcl::PFHEstimation< PointInT, PointNT, PointOutT >

PFHEstimation estimates the Point Feature Histogram (PFH) descriptor for a given point cloud dataset containing points and normals.

A commonly used type for PointOutT is pcl::PFHSignature125.

Note:
If you use this code in any academic work, please cite:
Attention:
The convention for PFH features is:
  • if a query point's nearest neighbors cannot be estimated, the PFH feature will be set to NaN (not a number)
  • it is impossible to estimate a PFH descriptor for a point that doesn't have finite 3D coordinates. Therefore, any point that contains NaN data on x, y, or z, will have its PFH feature property set to NaN.
Note:
The code is stateful as we do not expect this class to be multicore parallelized. Please look at FPFHEstimationOMP for examples on parallel implementations of the FPFH (Fast Point Feature Histogram).
Author:
Radu B. Rusu

Definition at line 101 of file pfh.h.


Member Typedef Documentation

template<typename PointInT, typename PointOutT>
typedef PCLBase<PointInT> pcl::Feature< PointInT, PointOutT >::BaseClass [inherited]

Reimplemented in pcl::RangeImageBorderExtractor, and pcl::NarfDescriptor.

Definition at line 110 of file feature.h.

template<typename PointInT, typename PointNT, typename PointOutT>
typedef boost::shared_ptr< const FeatureFromNormals<PointInT, PointNT, PointOutT> > pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >::ConstPtr [inherited]
template<typename PointInT, typename PointOutT>
typedef pcl::search::Search<PointInT> pcl::Feature< PointInT, PointOutT >::KdTree [inherited]

Definition at line 115 of file feature.h.

template<typename PointInT, typename PointOutT>
typedef pcl::search::Search<PointInT>::Ptr pcl::Feature< PointInT, PointOutT >::KdTreePtr [inherited]

Reimplemented in pcl::CVFHEstimation< PointInT, PointNT, PointOutT >.

Definition at line 116 of file feature.h.

typedef pcl::PointCloud<PointInT > pcl::PCLBase< PointInT >::PointCloud [inherited]

Definition at line 74 of file pcl_base.h.

typedef PointCloud::ConstPtr pcl::PCLBase< PointInT >::PointCloudConstPtr [inherited]
template<typename PointInT, typename PointNT, typename PointOutT = pcl::PFHSignature125>
typedef Feature<PointInT, PointOutT>::PointCloudIn pcl::PFHEstimation< PointInT, PointNT, PointOutT >::PointCloudIn

Reimplemented from pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >.

Definition at line 114 of file pfh.h.

template<typename PointInT, typename PointNT, typename PointOutT>
typedef pcl::PointCloud<PointNT> pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >::PointCloudN [inherited]

Definition at line 328 of file feature.h.

template<typename PointInT, typename PointNT, typename PointOutT>
typedef PointCloudN::ConstPtr pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >::PointCloudNConstPtr [inherited]

Definition at line 330 of file feature.h.

template<typename PointInT, typename PointNT, typename PointOutT>
typedef PointCloudN::Ptr pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >::PointCloudNPtr [inherited]

Definition at line 329 of file feature.h.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::PFHSignature125>
typedef Feature<PointInT, PointOutT>::PointCloudOut pcl::PFHEstimation< PointInT, PointNT, PointOutT >::PointCloudOut

Reimplemented from pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >.

Definition at line 113 of file pfh.h.

typedef PointCloud::Ptr pcl::PCLBase< PointInT >::PointCloudPtr [inherited]

Reimplemented in pcl::OrganizedFastMesh< PointInT >.

Definition at line 75 of file pcl_base.h.

typedef PointIndices::ConstPtr pcl::PCLBase< PointInT >::PointIndicesConstPtr [inherited]

Definition at line 79 of file pcl_base.h.

typedef PointIndices::Ptr pcl::PCLBase< PointInT >::PointIndicesPtr [inherited]

Definition at line 78 of file pcl_base.h.

template<typename PointInT, typename PointNT, typename PointOutT>
typedef boost::shared_ptr< FeatureFromNormals<PointInT, PointNT, PointOutT> > pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >::Ptr [inherited]
template<typename PointInT, typename PointOutT>
typedef boost::function<int (size_t, double, std::vector<int> &, std::vector<float> &)> pcl::Feature< PointInT, PointOutT >::SearchMethod [inherited]

Definition at line 124 of file feature.h.

template<typename PointInT, typename PointOutT>
typedef boost::function<int (const PointCloudIn &cloud, size_t index, double, std::vector<int> &, std::vector<float> &)> pcl::Feature< PointInT, PointOutT >::SearchMethodSurface [inherited]

Definition at line 125 of file feature.h.


Constructor & Destructor Documentation

template<typename PointInT, typename PointNT, typename PointOutT = pcl::PFHSignature125>
pcl::PFHEstimation< PointInT, PointNT, PointOutT >::PFHEstimation ( ) [inline]

Empty constructor.

Sets use_cache_ to false, nr_subdiv_ to 5, and the internal maximum cache size to 1GB.

Definition at line 119 of file pfh.h.


Member Function Documentation

template<typename PointInT , typename PointOutT >
void pcl::Feature< PointInT, PointOutT >::compute ( PointCloudOut output) [inherited]

Base method for feature estimation for all points given in <setInputCloud (), setIndices ()> using the surface in setSearchSurface () and the spatial locator in setSearchMethod ()

Parameters:
[out]outputthe resultant point cloud model dataset containing the estimated features

Reimplemented in pcl::CVFHEstimation< PointInT, PointNT, PointOutT >, pcl::VFHEstimation< PointInT, PointNT, PointOutT >, pcl::RangeImageBorderExtractor, pcl::ESFEstimation< PointInT, PointOutT >, and pcl::NarfDescriptor.

Definition at line 188 of file feature.hpp.

template<typename PointInT , typename PointOutT >
void pcl::Feature< PointInT, PointOutT >::computeEigen ( pcl::PointCloud< Eigen::MatrixXf > &  output) [inherited]

Base method for feature estimation for all points given in <setInputCloud (), setIndices ()> using the surface in setSearchSurface () and the spatial locator in setSearchMethod ()

Parameters:
[out]outputthe resultant point cloud model dataset containing the estimated features

Reimplemented in pcl::SHOTColorEstimation< PointInT, PointNT, Eigen::MatrixXf, PointRFT >, and pcl::SHOTEstimation< PointInT, PointNT, Eigen::MatrixXf, PointRFT >.

Definition at line 224 of file feature.hpp.

template<typename PointInT, typename PointNT, typename PointOutT >
bool pcl::PFHEstimation< PointInT, PointNT, PointOutT >::computePairFeatures ( const pcl::PointCloud< PointInT > &  cloud,
const pcl::PointCloud< PointNT > &  normals,
int  p_idx,
int  q_idx,
float &  f1,
float &  f2,
float &  f3,
float &  f4 
)

Compute the 4-tuple representation containing the three angles and one distance between two points represented by Cartesian coordinates and normals.

Note:
For explanations about the features, please see the literature mentioned above (the order of the features might be different).
Parameters:
[in]cloudthe dataset containing the XYZ Cartesian coordinates of the two points
[in]normalsthe dataset containing the surface normals (assuming normalized vectors) at each point in cloud
[in]p_idxthe index of the first point (source)
[in]q_idxthe index of the second point (target)
[out]f1the first angular feature (angle between the projection of nq_idx and u)
[out]f2the second angular feature (angle between nq_idx and v)
[out]f3the third angular feature (angle between np_idx and |p_idx - q_idx|)
[out]f4the distance feature (p_idx - q_idx)
Note:
For efficiency reasons, we assume that the point data passed to the method is finite.

Definition at line 47 of file pfh.hpp.

template<typename PointInT, typename PointNT, typename PointOutT >
void pcl::PFHEstimation< PointInT, PointNT, PointOutT >::computePointPFHSignature ( const pcl::PointCloud< PointInT > &  cloud,
const pcl::PointCloud< PointNT > &  normals,
const std::vector< int > &  indices,
int  nr_split,
Eigen::VectorXf &  pfh_histogram 
)

Estimate the PFH (Point Feature Histograms) individual signatures of the three angular (f1, f2, f3) features for a given point based on its spatial neighborhood of 3D points with normals.

Parameters:
[in]cloudthe dataset containing the XYZ Cartesian coordinates of the two points
[in]normalsthe dataset containing the surface normals at each point in cloud
[in]indicesthe k-neighborhood point indices in the dataset
[in]nr_splitthe number of subdivisions for each angular feature interval
[out]pfh_histogramthe resultant (combinatorial) PFH histogram representing the feature at the query point

Definition at line 59 of file pfh.hpp.

IndicesPtr const pcl::PCLBase< PointInT >::getIndices ( ) [inline, inherited]

Get a pointer to the vector of indices used.

Definition at line 190 of file pcl_base.h.

PointCloudConstPtr const pcl::PCLBase< PointInT >::getInputCloud ( ) [inline, inherited]

Get a pointer to the input point cloud dataset.

Definition at line 107 of file pcl_base.h.

template<typename PointInT, typename PointNT, typename PointOutT>
PointCloudNConstPtr pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >::getInputNormals ( ) const [inline, inherited]

Get a pointer to the normals of the input XYZ point cloud dataset.

Definition at line 355 of file feature.h.

template<typename PointInT, typename PointOutT>
int pcl::Feature< PointInT, PointOutT >::getKSearch ( ) const [inline, inherited]

get the number of k nearest neighbors used for the feature estimation.

Definition at line 186 of file feature.h.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::PFHSignature125>
unsigned int pcl::PFHEstimation< PointInT, PointNT, PointOutT >::getMaximumCacheSize ( ) [inline]

Get the maximum internal cache size.

Definition at line 144 of file pfh.h.

template<typename PointInT, typename PointOutT>
double pcl::Feature< PointInT, PointOutT >::getRadiusSearch ( ) const [inline, inherited]

Get the sphere radius used for determining the neighbors.

Definition at line 203 of file feature.h.

template<typename PointInT, typename PointOutT>
KdTreePtr pcl::Feature< PointInT, PointOutT >::getSearchMethod ( ) const [inline, inherited]

Get a pointer to the search method used.

Definition at line 166 of file feature.h.

template<typename PointInT, typename PointOutT>
double pcl::Feature< PointInT, PointOutT >::getSearchParameter ( ) const [inline, inherited]

Get the internal search parameter.

Definition at line 173 of file feature.h.

template<typename PointInT, typename PointOutT>
PointCloudInConstPtr pcl::Feature< PointInT, PointOutT >::getSearchSurface ( ) const [inline, inherited]

Get a pointer to the surface point cloud dataset.

Definition at line 153 of file feature.h.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::PFHSignature125>
bool pcl::PFHEstimation< PointInT, PointNT, PointOutT >::getUseInternalCache ( ) [inline]

Get whether the internal cache is used or not for computing the PFH features.

Definition at line 168 of file pfh.h.

const PointInT & pcl::PCLBase< PointInT >::operator[] ( size_t  pos) [inline, inherited]

Override PointCloud operator[] to shorten code.

Note:
this method can be called instead of (*input_)[(*indices_)[pos]] or input_->points[(*indices_)[pos]]
Parameters:
posposition in indices_ vector

Definition at line 197 of file pcl_base.h.

void pcl::PCLBase< PointInT >::setIndices ( const IndicesPtr indices) [inline, inherited]

Provide a pointer to the vector of indices that represents the input data.

Parameters:
indicesa pointer to the vector of indices that represents the input data.

Definition at line 113 of file pcl_base.h.

void pcl::PCLBase< PointInT >::setIndices ( const IndicesConstPtr indices) [inline, inherited]

Provide a pointer to the vector of indices that represents the input data.

Parameters:
indicesa pointer to the vector of indices that represents the input data.

Definition at line 124 of file pcl_base.h.

void pcl::PCLBase< PointInT >::setIndices ( const PointIndicesConstPtr indices) [inline, inherited]

Provide a pointer to the vector of indices that represents the input data.

Parameters:
indicesa pointer to the vector of indices that represents the input data.

Definition at line 135 of file pcl_base.h.

void pcl::PCLBase< PointInT >::setIndices ( size_t  row_start,
size_t  col_start,
size_t  nb_rows,
size_t  nb_cols 
) [inline, inherited]

Set the indices for the points laying within an interest region of the point cloud.

Note:
you shouldn't call this method on unorganized point clouds!
Parameters:
row_startthe offset on rows
col_startthe offset on columns
nb_rowsthe number of rows to be considered row_start included
nb_colsthe number of columns to be considered col_start included

Definition at line 151 of file pcl_base.h.

virtual void pcl::PCLBase< PointInT >::setInputCloud ( const PointCloudConstPtr cloud) [inline, virtual, inherited]

Provide a pointer to the input dataset.

Parameters:
cloudthe const boost shared pointer to a PointCloud message

Definition at line 103 of file pcl_base.h.

template<typename PointInT, typename PointNT, typename PointOutT>
void pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >::setInputNormals ( const PointCloudNConstPtr normals) [inline, inherited]

Provide a pointer to the input dataset that contains the point normals of the XYZ dataset.

In case of search surface is set to be different from the input cloud, normals should correspond to the search surface, not the input cloud!

Parameters:
[in]normalsthe const boost shared pointer to a PointCloud of normals. By convention, L2 norm of each normal should be 1.

Definition at line 351 of file feature.h.

template<typename PointInT, typename PointOutT>
void pcl::Feature< PointInT, PointOutT >::setKSearch ( int  k) [inline, inherited]

Set the number of k nearest neighbors to use for the feature estimation.

Parameters:
[in]kthe number of k-nearest neighbors

Reimplemented in pcl::RSDEstimation< PointInT, PointNT, PointOutT >.

Definition at line 182 of file feature.h.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::PFHSignature125>
void pcl::PFHEstimation< PointInT, PointNT, PointOutT >::setMaximumCacheSize ( unsigned int  cache_size) [inline]

Set the maximum internal cache size.

Defaults to 2GB worth of entries.

Parameters:
[in]cache_sizemaximum cache size

Definition at line 137 of file pfh.h.

template<typename PointInT, typename PointOutT>
void pcl::Feature< PointInT, PointOutT >::setRadiusSearch ( double  radius) [inline, inherited]

Set the sphere radius that is to be used for determining the nearest neighbors used for the feature estimation.

Parameters:
[in]radiusthe sphere radius used as the maximum distance to consider a point a neighbor

Definition at line 196 of file feature.h.

template<typename PointInT, typename PointOutT>
void pcl::Feature< PointInT, PointOutT >::setSearchMethod ( const KdTreePtr tree) [inline, inherited]

Provide a pointer to the search object.

Parameters:
[in]treea pointer to the spatial search object.

Definition at line 162 of file feature.h.

template<typename PointInT, typename PointOutT>
void pcl::Feature< PointInT, PointOutT >::setSearchSurface ( const PointCloudInConstPtr cloud) [inline, inherited]

Provide a pointer to a dataset to add additional information to estimate the features for every point in the input dataset.

This is optional, if this is not set, it will only use the data in the input cloud to estimate the features. This is useful when you only need to compute the features for a downsampled cloud.

Parameters:
[in]clouda pointer to a PointCloud message

Definition at line 144 of file feature.h.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::PFHSignature125>
void pcl::PFHEstimation< PointInT, PointNT, PointOutT >::setUseInternalCache ( bool  use_cache) [inline]

Set whether to use an internal cache mechanism for removing redundant calculations or not.

Note:
Depending on how the point cloud is ordered and how the nearest neighbors are estimated, using a cache could have a positive or a negative influence. Please test with and without a cache on your data, and choose whatever works best!

See setMaximumCacheSize for setting the maximum cache size

Parameters:
[in]use_cacheset to true to use the internal cache, false otherwise

Definition at line 161 of file pfh.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines