Point Cloud Library (PCL)
1.14.1-dev
|
VFHEstimation estimates the Viewpoint Feature Histogram (VFH) descriptor for a given point cloud dataset containing points and normals. More...
#include <pcl/features/vfh.h>
Public Types | |
using | PointCloudOut = typename Feature< PointInT, PointOutT >::PointCloudOut |
using | Ptr = shared_ptr< VFHEstimation< PointInT, PointNT, PointOutT > > |
using | ConstPtr = shared_ptr< const VFHEstimation< PointInT, PointNT, PointOutT > > |
![]() | |
using | PointCloudN = pcl::PointCloud< PointNT > |
using | PointCloudNPtr = typename PointCloudN::Ptr |
using | PointCloudNConstPtr = typename PointCloudN::ConstPtr |
using | Ptr = shared_ptr< FeatureFromNormals< PointInT, PointNT, pcl::VFHSignature308 > > |
using | ConstPtr = shared_ptr< const FeatureFromNormals< PointInT, PointNT, pcl::VFHSignature308 > > |
![]() | |
using | BaseClass = PCLBase< PointInT > |
using | Ptr = shared_ptr< Feature< PointInT, PointOutT > > |
using | ConstPtr = shared_ptr< const Feature< PointInT, PointOutT > > |
using | KdTree = pcl::search::Search< PointInT > |
using | KdTreePtr = typename KdTree::Ptr |
using | PointCloudIn = pcl::PointCloud< PointInT > |
using | PointCloudInPtr = typename PointCloudIn::Ptr |
using | PointCloudInConstPtr = typename PointCloudIn::ConstPtr |
using | PointCloudOut = pcl::PointCloud< PointOutT > |
using | SearchMethod = std::function< int(std::size_t, double, pcl::Indices &, std::vector< float > &)> |
using | SearchMethodSurface = std::function< int(const PointCloudIn &cloud, std::size_t index, double, pcl::Indices &, std::vector< float > &)> |
![]() | |
using | PointCloud = pcl::PointCloud< PointInT > |
using | PointCloudPtr = typename PointCloud::Ptr |
using | PointCloudConstPtr = typename PointCloud::ConstPtr |
using | PointIndicesPtr = PointIndices::Ptr |
using | PointIndicesConstPtr = PointIndices::ConstPtr |
Public Member Functions | |
VFHEstimation () | |
Empty constructor. More... | |
void | computePointSPFHSignature (const Eigen::Vector4f ¢roid_p, const Eigen::Vector4f ¢roid_n, const pcl::PointCloud< PointInT > &cloud, const pcl::PointCloud< PointNT > &normals, const pcl::Indices &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 ¢roid) |
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... | |
![]() | |
FeatureFromNormals () | |
Empty constructor. 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... | |
![]() | |
Feature () | |
Empty constructor. 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... | |
![]() | |
PCLBase () | |
Empty constructor. More... | |
PCLBase (const PCLBase &base) | |
Copy constructor. More... | |
virtual | ~PCLBase ()=default |
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 | 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[] (std::size_t pos) const |
Override PointCloud operator[] to shorten code. More... | |
Protected Member Functions | |
bool | initCompute () override |
This method should get called before starting the actual computation. More... | |
![]() | |
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 (std::size_t index, double parameter, pcl::Indices &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, std::size_t index, double parameter, pcl::Indices &indices, std::vector< float > &distances) const |
Search for k-nearest neighbors using the spatial locator from setSearchmethod, and the given surface from setSearchSurface. More... | |
![]() | |
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 | |
std::array< Eigen::VectorXf, 4 > | hist_f_ |
Placeholder for the f1 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_ {false} |
Use the normal_to_use_. More... | |
bool | use_given_centroid_ {false} |
Use the centroid_to_use_. More... | |
bool | normalize_bins_ {true} |
Normalize bins by the number the total number of points. More... | |
bool | normalize_distances_ {false} |
Normalize the shape distribution component of VFH. More... | |
bool | size_component_ {false} |
Activate or deactivate the size component of VFH. More... | |
![]() | |
PointCloudNConstPtr | normals_ |
A pointer to the input dataset that contains the point normals of the XYZ dataset. More... | |
![]() | |
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... | |
![]() | |
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... | |
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->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.
using pcl::VFHEstimation< PointInT, PointNT, PointOutT >::ConstPtr = shared_ptr<const VFHEstimation<PointInT, PointNT, PointOutT> > |
using pcl::VFHEstimation< PointInT, PointNT, PointOutT >::PointCloudOut = typename Feature<PointInT, PointOutT>::PointCloudOut |
using pcl::VFHEstimation< PointInT, PointNT, PointOutT >::Ptr = shared_ptr<VFHEstimation<PointInT, PointNT, PointOutT> > |
|
inline |
void pcl::VFHEstimation< PointInT, PointNT, PointOutT >::compute | ( | PointCloudOut & | output | ) |
Overloaded computed method from pcl::Feature.
[out] | output | the resultant point cloud model dataset containing the estimated features |
Definition at line 65 of file vfh.hpp.
References pcl::PointCloud< PointT >::clear(), pcl::PointCloud< PointT >::header, pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::is_dense, pcl::PointCloud< PointT >::resize(), and pcl::PointCloud< PointT >::width.
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 pcl::Indices & | 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.
[in] | centroid_p | the centroid point |
[in] | centroid_n | the centroid normal |
[in] | cloud | the dataset containing the XYZ Cartesian coordinates of the two points |
[in] | normals | the dataset containing the surface normals at each point in cloud |
[in] | indices | the k-neighborhood point indices in the dataset |
Definition at line 92 of file vfh.hpp.
References pcl::computePairFeatures(), pcl::getMaxDistance(), M_PI, and pcl_round().
|
inline |
|
overrideprotectedvirtual |
This method should get called before starting the actual computation.
Reimplemented from pcl::FeatureFromNormals< PointInT, PointNT, pcl::VFHSignature308 >.
|
inline |
Set centroid_to_use_.
[in] | centroid | Centroid to be used in the VFH computation. It is used to compute the distances from all points to this centroid. |
Definition at line 171 of file vfh.h.
References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::centroid_to_use_.
|
inline |
set size_component_
[in] | fill_size | True if the 4th component of VFH (shape distribution component) needs to be filled. Otherwise, it is set to zero. |
Definition at line 200 of file vfh.h.
References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::size_component_.
|
inline |
set normalize_bins_
[in] | normalize | If true, the VFH bins are normalized using the total number of points |
Definition at line 180 of file vfh.h.
References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::normalize_bins_.
|
inline |
set normalize_distances_
[in] | normalize | If 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 190 of file vfh.h.
References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::normalize_distances_.
|
inline |
Set the normal to use.
[in] | normal | Sets the normal to be used in the VFH computation. It is is used to build the Darboux Coordinate system. |
Definition at line 152 of file vfh.h.
References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::normal_to_use_.
|
inline |
Set use_given_centroid_.
[in] | use | Set to true if you want to use the centroid passed through setCentroidToUse(centroid) |
Definition at line 161 of file vfh.h.
References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::use_given_centroid_.
|
inline |
Set use_given_normal_.
[in] | use | Set to true if you want to use the normal passed to setNormalUse(normal) |
Definition at line 142 of file vfh.h.
References pcl::VFHEstimation< PointInT, PointNT, PointOutT >::use_given_normal_.
|
inline |
|
protected |
Centroid to be used to computed VFH.
Default, the centroid of the whole point cloud
Definition at line 243 of file vfh.h.
Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setCentroidToUse().
|
protected |
|
protected |
|
protected |
Normal to be used to computed VFH.
Default, the average normal of the whole point cloud
Definition at line 241 of file vfh.h.
Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setNormalToUse().
|
protected |
Normalize bins by the number the total number of points.
Definition at line 252 of file vfh.h.
Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setNormalizeBins().
|
protected |
Normalize the shape distribution component of VFH.
Definition at line 254 of file vfh.h.
Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setNormalizeDistance().
|
protected |
Activate or deactivate the size component of VFH.
Definition at line 256 of file vfh.h.
Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setFillSizeComponent().
|
protected |
Use the centroid_to_use_.
Definition at line 250 of file vfh.h.
Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setUseGivenCentroid().
|
protected |
Use the normal_to_use_.
Definition at line 248 of file vfh.h.
Referenced by pcl::VFHEstimation< PointInT, PointNT, PointOutT >::setUseGivenNormal().