Point Cloud Library (PCL)  1.8.1-dev
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::VFHEstimation< PointInT, PointNT, PointOutT > Class Template Reference

VFHEstimation estimates the Viewpoint Feature Histogram (VFH) descriptor for a given point cloud dataset containing points and normals. More...

#include <pcl/features/vfh.h>

+ Inheritance diagram for pcl::VFHEstimation< PointInT, PointNT, PointOutT >:

Public Types

typedef Feature< PointInT,
PointOutT >::PointCloudOut 
PointCloudOut
 
typedef boost::shared_ptr
< VFHEstimation< PointInT,
PointNT, PointOutT > > 
Ptr
 
typedef boost::shared_ptr
< const VFHEstimation
< PointInT, PointNT, PointOutT > > 
ConstPtr
 
- Public Types inherited from pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >
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
 
- Public Types inherited from pcl::Feature< PointInT, PointOutT >
typedef PCLBase< PointInT > BaseClass
 
typedef boost::shared_ptr
< Feature< PointInT, PointOutT > > 
Ptr
 
typedef boost::shared_ptr
< const Feature< PointInT,
PointOutT > > 
ConstPtr
 
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
< PointOutT > 
PointCloudOut
 
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
 
- 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

 VFHEstimation ()
 Empty constructor. More...
 
void computePointSPFHSignature (const Eigen::Vector4f &centroid_p, const Eigen::Vector4f &centroid_n, const pcl::PointCloud< PointInT > &cloud, const pcl::PointCloud< PointNT > &normals, const std::vector< int > &indices)
 Estimate the SPFH (Simple Point Feature Histograms) signatures of the angular (f1, f2, f3) and distance (f4) features for a given point from its neighborhood. More...
 
void setViewPoint (float vpx, float vpy, float vpz)
 Set the viewpoint. More...
 
void getViewPoint (float &vpx, float &vpy, float &vpz)
 Get the viewpoint. More...
 
void setUseGivenNormal (bool use)
 Set use_given_normal_. More...
 
void setNormalToUse (const Eigen::Vector3f &normal)
 Set the normal to use. More...
 
void setUseGivenCentroid (bool use)
 Set use_given_centroid_. More...
 
void setCentroidToUse (const Eigen::Vector3f &centroid)
 Set centroid_to_use_. More...
 
void setNormalizeBins (bool normalize)
 set normalize_bins_ More...
 
void setNormalizeDistance (bool normalize)
 set normalize_distances_ More...
 
void setFillSizeComponent (bool fill_size)
 set size_component_ More...
 
void compute (PointCloudOut &output)
 Overloaded computed method from pcl::Feature. More...
 
- Public Member Functions inherited from pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >
 FeatureFromNormals ()
 Empty constructor. More...
 
virtual ~FeatureFromNormals ()
 Empty destructor. More...
 
void setInputNormals (const PointCloudNConstPtr &normals)
 Provide a pointer to the input dataset that contains the point normals of the XYZ dataset. More...
 
PointCloudNConstPtr getInputNormals () const
 Get a pointer to the normals of the input XYZ point cloud dataset. More...
 
- Public Member Functions inherited from pcl::Feature< PointInT, PointOutT >
 Feature ()
 Empty constructor. More...
 
virtual ~Feature ()
 Empty destructor. More...
 
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. More...
 
PointCloudInConstPtr getSearchSurface () const
 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 () const
 Get a pointer to the search method used. More...
 
double getSearchParameter () const
 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 () const
 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 feature estimation. More...
 
double getRadiusSearch () const
 Get the sphere radius used for determining the neighbors. More...
 
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 () 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

bool initCompute ()
 This method should get called before starting the actual computation. More...
 
- Protected Member Functions inherited from pcl::Feature< PointInT, PointOutT >
const std::string & getClassName () const
 Get a string representation of the name of this class. More...
 
virtual bool deinitCompute ()
 This method should get called after ending the actual computation. More...
 
int searchForNeighbors (size_t 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...
 
int searchForNeighbors (const PointCloudIn &cloud, size_t 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...
 
- 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

Eigen::VectorXf hist_f1_
 Placeholder for the f1 histogram. More...
 
Eigen::VectorXf hist_f2_
 Placeholder for the f2 histogram. More...
 
Eigen::VectorXf hist_f3_
 Placeholder for the f3 histogram. More...
 
Eigen::VectorXf hist_f4_
 Placeholder for the f4 histogram. More...
 
Eigen::VectorXf hist_vp_
 Placeholder for the vp histogram. More...
 
Eigen::Vector4f normal_to_use_
 Normal to be used to computed VFH. More...
 
Eigen::Vector4f centroid_to_use_
 Centroid to be used to computed VFH. More...
 
bool use_given_normal_
 Use the normal_to_use_. More...
 
bool use_given_centroid_
 Use the centroid_to_use_. More...
 
bool normalize_bins_
 Normalize bins by the number the total number of points. More...
 
bool normalize_distances_
 Normalize the shape distribution component of VFH. More...
 
bool size_component_
 Activate or deactivate the size component of VFH. More...
 
- Protected Attributes inherited from pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >
PointCloudNConstPtr normals_
 A pointer to the input dataset that contains the point normals of the XYZ dataset. More...
 
- Protected Attributes inherited from pcl::Feature< PointInT, PointOutT >
std::string feature_name_
 The feature name. 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 (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...
 
bool fake_surface_
 If no surface is given, we use the input PointCloud as the surface. 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, typename PointNT, typename PointOutT = pcl::VFHSignature308>
class pcl::VFHEstimation< PointInT, PointNT, PointOutT >

VFHEstimation estimates the Viewpoint Feature Histogram (VFH) descriptor for a given point cloud dataset containing points and normals.

The default VFH implementation uses 45 binning subdivisions for each of the three extended FPFH values, plus another 45 binning subdivisions for the distances between each point and the centroid and 128 binning subdivisions for the viewpoint component, which results in a 308-byte array of float values. These are stored in a pcl::VFHSignature308 point type. A major difference between the PFH/FPFH descriptors and VFH, is that for a given point cloud dataset, only a single VFH descriptor will be estimated (vfhs->points.size() should be 1), while the resultant PFH/FPFH data will have the same number of entries as the number of points in the cloud.

Note
If you use this code in any academic work, please cite:
Note
The code is stateful as we do not expect this class to be multicore parallelized. Please look at FPFHEstimationOMP for an example of a parallel implementation of the FPFH (Fast Point Feature Histogram).
Author
Radu B. Rusu

Definition at line 71 of file vfh.h.

Member Typedef Documentation

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
typedef boost::shared_ptr<const VFHEstimation<PointInT, PointNT, PointOutT> > pcl::VFHEstimation< PointInT, PointNT, PointOutT >::ConstPtr

Definition at line 85 of file vfh.h.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
typedef Feature<PointInT, PointOutT>::PointCloudOut pcl::VFHEstimation< PointInT, PointNT, PointOutT >::PointCloudOut

Definition at line 83 of file vfh.h.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
typedef boost::shared_ptr<VFHEstimation<PointInT, PointNT, PointOutT> > pcl::VFHEstimation< PointInT, PointNT, PointOutT >::Ptr

Definition at line 84 of file vfh.h.

Constructor & Destructor Documentation

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
pcl::VFHEstimation< PointInT, PointNT, PointOutT >::VFHEstimation ( )
inline

Member Function Documentation

template<typename PointInT , typename PointNT , typename PointOutT >
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::compute ( PointCloudOut output)

Overloaded computed method from pcl::Feature.

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

Definition at line 65 of file vfh.hpp.

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

template<typename PointInT , typename PointNT , typename PointOutT >
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::computePointSPFHSignature ( const Eigen::Vector4f &  centroid_p,
const Eigen::Vector4f &  centroid_n,
const pcl::PointCloud< PointInT > &  cloud,
const pcl::PointCloud< PointNT > &  normals,
const std::vector< int > &  indices 
)

Estimate the SPFH (Simple Point Feature Histograms) signatures of the angular (f1, f2, f3) and distance (f4) features for a given point from its neighborhood.

Parameters
[in]centroid_pthe centroid point
[in]centroid_nthe centroid normal
[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

Definition at line 92 of file vfh.hpp.

References pcl::computePairFeatures(), pcl::getMaxDistance(), and pcl::PointCloud< T >::points.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::getViewPoint ( float &  vpx,
float &  vpy,
float &  vpz 
)
inline

Get the viewpoint.

Definition at line 134 of file vfh.h.

template<typename PointInT , typename PointNT , typename PointOutT >
bool pcl::VFHEstimation< PointInT, PointNT, PointOutT >::initCompute ( )
protectedvirtual

This method should get called before starting the actual computation.

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

Definition at line 51 of file vfh.hpp.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setCentroidToUse ( const Eigen::Vector3f &  centroid)
inline

Set centroid_to_use_.

Parameters
[in]centroidCentroid to be used in the VFH computation. It is used to compute the distances from all points to this centroid.

Definition at line 174 of file vfh.h.

References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::centroid_to_use_.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setFillSizeComponent ( bool  fill_size)
inline

set size_component_

Parameters
[in]fill_sizeTrue if the 4th component of VFH (shape distribution component) needs to be filled. Otherwise, it is set to zero.

Definition at line 203 of file vfh.h.

References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::size_component_.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setNormalizeBins ( bool  normalize)
inline

set normalize_bins_

Parameters
[in]normalizeIf true, the VFH bins are normalized using the total number of points

Definition at line 183 of file vfh.h.

References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::normalize_bins_.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setNormalizeDistance ( bool  normalize)
inline

set normalize_distances_

Parameters
[in]normalizeIf true, the 4th component of VFH (shape distribution component) get normalized by the maximum size between the centroid and the point cloud

Definition at line 193 of file vfh.h.

References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::normalize_distances_.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setNormalToUse ( const Eigen::Vector3f &  normal)
inline

Set the normal to use.

Parameters
[in]normalSets the normal to be used in the VFH computation. It is is used to build the Darboux Coordinate system.

Definition at line 155 of file vfh.h.

References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::normal_to_use_.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setUseGivenCentroid ( bool  use)
inline

Set use_given_centroid_.

Parameters
[in]useSet to true if you want to use the centroid passed through setCentroidToUse(centroid)

Definition at line 164 of file vfh.h.

References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::use_given_centroid_.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setUseGivenNormal ( bool  use)
inline

Set use_given_normal_.

Parameters
[in]useSet to true if you want to use the normal passed to setNormalUse(normal)

Definition at line 145 of file vfh.h.

References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::use_given_normal_.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setViewPoint ( float  vpx,
float  vpy,
float  vpz 
)
inline

Set the viewpoint.

Parameters
[in]vpxthe X coordinate of the viewpoint
[in]vpythe Y coordinate of the viewpoint
[in]vpzthe Z coordinate of the viewpoint

Definition at line 125 of file vfh.h.

Member Data Documentation

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
Eigen::Vector4f pcl::VFHEstimation< PointInT, PointNT, PointOutT >::centroid_to_use_
protected

Centroid to be used to computed VFH.

Default, the centroid of the whole point cloud

Definition at line 251 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setCentroidToUse().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
Eigen::VectorXf pcl::VFHEstimation< PointInT, PointNT, PointOutT >::hist_f1_
protected

Placeholder for the f1 histogram.

Definition at line 238 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::VFHEstimation().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
Eigen::VectorXf pcl::VFHEstimation< PointInT, PointNT, PointOutT >::hist_f2_
protected

Placeholder for the f2 histogram.

Definition at line 240 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::VFHEstimation().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
Eigen::VectorXf pcl::VFHEstimation< PointInT, PointNT, PointOutT >::hist_f3_
protected

Placeholder for the f3 histogram.

Definition at line 242 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::VFHEstimation().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
Eigen::VectorXf pcl::VFHEstimation< PointInT, PointNT, PointOutT >::hist_f4_
protected

Placeholder for the f4 histogram.

Definition at line 244 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::VFHEstimation().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
Eigen::VectorXf pcl::VFHEstimation< PointInT, PointNT, PointOutT >::hist_vp_
protected

Placeholder for the vp histogram.

Definition at line 246 of file vfh.h.

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
Eigen::Vector4f pcl::VFHEstimation< PointInT, PointNT, PointOutT >::normal_to_use_
protected

Normal to be used to computed VFH.

Default, the average normal of the whole point cloud

Definition at line 249 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setNormalToUse().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
bool pcl::VFHEstimation< PointInT, PointNT, PointOutT >::normalize_bins_
protected

Normalize bins by the number the total number of points.

Definition at line 260 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setNormalizeBins().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
bool pcl::VFHEstimation< PointInT, PointNT, PointOutT >::normalize_distances_
protected

Normalize the shape distribution component of VFH.

Definition at line 262 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setNormalizeDistance().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
bool pcl::VFHEstimation< PointInT, PointNT, PointOutT >::size_component_
protected

Activate or deactivate the size component of VFH.

Definition at line 264 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setFillSizeComponent().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
bool pcl::VFHEstimation< PointInT, PointNT, PointOutT >::use_given_centroid_
protected

Use the centroid_to_use_.

Definition at line 258 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setUseGivenCentroid().

template<typename PointInT, typename PointNT, typename PointOutT = pcl::VFHSignature308>
bool pcl::VFHEstimation< PointInT, PointNT, PointOutT >::use_given_normal_
protected

Use the normal_to_use_.

Definition at line 256 of file vfh.h.

Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setUseGivenNormal().


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