Point Cloud Library (PCL) 1.12.0
Loading...
Searching...
No Matches
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::Feature< PointInT, PointOutT > Class Template Referenceabstract

Feature represents the base feature class. More...

#include <pcl/features/feature.h>

+ Inheritance diagram for pcl::Feature< PointInT, PointOutT >:
+ Collaboration diagram for pcl::Feature< PointInT, PointOutT >:

Public Types

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> &)>
 
- Public Types inherited from pcl::PCLBase< PointInT >
using PointCloud
 
using PointCloudPtr
 
using PointCloudConstPtr
 
using PointIndicesPtr
 
using PointIndicesConstPtr
 

Public Member Functions

 Feature ()
 Empty constructor.
 
virtual ~Feature ()
 Empty destructor.
 
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 ()
 
- Public Member Functions inherited from pcl::PCLBase< PointInT >
 PCLBase ()
 Empty constructor.
 
 PCLBase (const PCLBase &base)
 Copy constructor.
 
virtual ~PCLBase ()=default
 Destructor.
 
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset.
 
PointCloudConstPtr const getInputCloud () const
 Get a pointer to the input point cloud dataset.
 
virtual void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data.
 
virtual void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data.
 
virtual void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data.
 
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.
 
IndicesPtr getIndices ()
 Get a pointer to the vector of indices used.
 
IndicesConstPtr const getIndices () const
 Get a pointer to the vector of indices used.
 
const PointInToperator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code.
 

Protected Member Functions

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

Protected Attributes

std::string feature_name_
 The feature name.
 
SearchMethodSurface search_method_surface_
 The search method template for points.
 
PointCloudInConstPtr surface_
 An input point cloud describing the surface that is to be used for nearest neighbors estimation.
 
KdTreePtr tree_
 A pointer to the spatial search object.
 
double search_parameter_
 The actual search parameter (from either search_radius_ or k_).
 
double search_radius_
 The nearest neighbors search radius for each point.
 
int k_
 The number of K nearest neighbors to use for each point.
 
bool fake_surface_
 If no surface is given, we use the input PointCloud as the surface.
 
- Protected Attributes inherited from pcl::PCLBase< PointInT >
PointCloudConstPtr input_
 The input point cloud dataset.
 
IndicesPtr indices_
 A pointer to the vector of point indices to use.
 
bool use_indices_
 Set to true if point indices are used.
 
bool fake_indices_
 If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud.
 

Detailed Description

template<typename PointInT, typename PointOutT>
class pcl::Feature< PointInT, PointOutT >

Feature represents the base feature class.

Some generic 3D operations that are applicable to all features are defined here as static methods.

Attention
The convention for a feature descriptor is:
  • if the nearest neighbors for the query point at which the descriptor is to be computed cannot be determined, the descriptor values will be set to NaN (not a number)
  • it is impossible to estimate a feature descriptor for a point that doesn't have finite 3D coordinates. Therefore, any point that has NaN data on x, y, or z, will most likely have its descriptor set to NaN.
Author
Radu B. Rusu

Definition at line 106 of file feature.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 112 of file feature.h.

◆ ConstPtr

Definition at line 115 of file feature.h.

◆ KdTree

Definition at line 117 of file feature.h.

◆ KdTreePtr

Definition at line 118 of file feature.h.

◆ PointCloudIn

Definition at line 120 of file feature.h.

◆ PointCloudInConstPtr

Definition at line 122 of file feature.h.

◆ PointCloudInPtr

Definition at line 121 of file feature.h.

◆ PointCloudOut

Definition at line 124 of file feature.h.

◆ Ptr

Definition at line 114 of file feature.h.

◆ SearchMethod

using pcl::Feature< PointInT, PointOutT >::SearchMethod = std::function<int (std::size_t, double, pcl::Indices &, std::vector<float> &)>

Definition at line 126 of file feature.h.

◆ SearchMethodSurface

using pcl::Feature< PointInT, PointOutT >::SearchMethodSurface = std::function<int (const PointCloudIn &cloud, std::size_t index, double, pcl::Indices &, std::vector<float> &)>

Definition at line 127 of file feature.h.

Constructor & Destructor Documentation

◆ Feature()

pcl::Feature< PointInT, PointOutT >::Feature ( )
inline

Empty constructor.

Definition at line 131 of file feature.h.

◆ ~Feature()

Empty destructor.

Definition at line 139 of file feature.h.

Member Function Documentation

◆ compute()

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

Definition at line 194 of file feature.hpp.

References pcl::ConstCloudIterator< PointT >::size().

◆ deinitCompute()

bool pcl::Feature< PointInT, PointOutT >::deinitCompute ( )
protectedvirtual

◆ getClassName()

const std::string & pcl::Feature< PointInT, PointOutT >::getClassName ( ) const
inlineprotected

Get a string representation of the name of this class.

Definition at line 247 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::feature_name_.

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

◆ getKSearch()

int pcl::Feature< PointInT, PointOutT >::getKSearch ( ) const
inline

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

Definition at line 191 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::k_.

◆ getRadiusSearch()

double pcl::Feature< PointInT, PointOutT >::getRadiusSearch ( ) const
inline

Get the sphere radius used for determining the neighbors.

Definition at line 208 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::search_radius_.

◆ getSearchMethod()

KdTreePtr pcl::Feature< PointInT, PointOutT >::getSearchMethod ( ) const
inline

Get a pointer to the search method used.

Definition at line 171 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::tree_.

◆ getSearchParameter()

double pcl::Feature< PointInT, PointOutT >::getSearchParameter ( ) const
inline

Get the internal search parameter.

Definition at line 178 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::search_parameter_.

◆ getSearchSurface()

PointCloudInConstPtr pcl::Feature< PointInT, PointOutT >::getSearchSurface ( ) const
inline

Get a pointer to the surface point cloud dataset.

Definition at line 158 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::surface_.

◆ initCompute()

bool pcl::Feature< PointInT, PointOutT >::initCompute ( )
protectedvirtual

This method should get called before starting the actual computation.

Reimplemented in pcl::FeatureFromNormals< PointInT, PointNT, PointOutT >, pcl::FeatureFromNormals< PointInT, PointNT, pcl::FPFHSignature33 >, pcl::FeatureFromNormals< PointInT, PointNT, pcl::Histogram< 90 > >, pcl::FeatureFromNormals< PointInT, PointNT, pcl::PFHRGBSignature250 >, pcl::FeatureFromNormals< PointInT, PointNT, pcl::PFHSignature125 >, pcl::FeatureFromNormals< PointInT, PointNT, pcl::PrincipalCurvatures >, pcl::FeatureFromNormals< PointInT, PointNT, pcl::ShapeContext1980 >, pcl::FeatureFromNormals< PointInT, PointNT, pcl::SHOT1344 >, pcl::FeatureFromNormals< PointInT, PointNT, pcl::SHOT352 >, pcl::FeatureFromNormals< PointInT, PointNT, pcl::VFHSignature308 >, pcl::FeatureFromNormals< PointInT, PointNT, ReferenceFrame >, pcl::FeatureFromNormals< PointT, PointNT, PointFeature >, pcl::FeatureFromLabels< PointInT, PointLT, PointOutT >, pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >, pcl::DifferenceOfNormalsEstimation< PointInT, PointNT, PointOutT >, pcl::FLARELocalReferenceFrameEstimation< PointInT, PointNT, PointOutT, SignedDistanceT >, pcl::SHOTEstimationBase< PointInT, PointNT, PointOutT, PointRFT >, pcl::SHOTEstimationBase< PointInT, PointNT, pcl::SHOT1344, pcl::ReferenceFrame >, pcl::SHOTEstimationBase< PointInT, PointNT, pcl::SHOT352, pcl::ReferenceFrame >, pcl::SHOTEstimationOMP< PointInT, PointNT, PointOutT, PointRFT >, pcl::SHOTColorEstimationOMP< PointInT, PointNT, PointOutT, PointRFT >, pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >, pcl::UniqueShapeContext< PointInT, PointOutT, PointRFT >, and pcl::VFHEstimation< PointInT, PointNT, PointOutT >.

Definition at line 95 of file feature.hpp.

References pcl::ConstCloudIterator< PointT >::ConstCloudIterator().

◆ searchForNeighbors() [1/2]

int pcl::Feature< PointInT, PointOutT >::searchForNeighbors ( const PointCloudIn & cloud,
std::size_t index,
double parameter,
pcl::Indices & indices,
std::vector< float > & distances ) const
inlineprotected

Search for k-nearest neighbors using the spatial locator from setSearchmethod, and the given surface from setSearchSurface.

Parameters
[in]cloudthe query point cloud
[in]indexthe index of the query point in cloud
[in]parameterthe search parameter (either k or radius)
[out]indicesthe resultant vector of indices representing the k-nearest neighbors
[out]distancesthe resultant vector of distances representing the distances from the query point to the k-nearest neighbors
Returns
the number of neighbors found. If no neighbors are found or an error occurred, return 0.

Definition at line 289 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::search_method_surface_.

◆ searchForNeighbors() [2/2]

int pcl::Feature< PointInT, PointOutT >::searchForNeighbors ( std::size_t index,
double parameter,
pcl::Indices & indices,
std::vector< float > & distances ) const
inlineprotected

Search for k-nearest neighbors using the spatial locator from setSearchmethod, and the given surface from setSearchSurface.

Parameters
[in]indexthe index of the query point
[in]parameterthe search parameter (either k or radius)
[out]indicesthe resultant vector of indices representing the k-nearest neighbors
[out]distancesthe resultant vector of distances representing the distances from the query point to the k-nearest neighbors
Returns
the number of neighbors found. If no neighbors are found or an error occurred, return 0.

Definition at line 271 of file feature.h.

References pcl::PCLBase< PointInT >::input_, and pcl::Feature< PointInT, PointOutT >::search_method_surface_.

◆ setKSearch()

void pcl::Feature< PointInT, PointOutT >::setKSearch ( int k)
inline

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

Parameters
[in]kthe number of k-nearest neighbors

Definition at line 187 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::k_.

◆ setRadiusSearch()

void pcl::Feature< PointInT, PointOutT >::setRadiusSearch ( double radius)
inline

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 201 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::search_radius_.

◆ setSearchMethod()

void pcl::Feature< PointInT, PointOutT >::setSearchMethod ( const KdTreePtr & tree)
inline

Provide a pointer to the search object.

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

Definition at line 167 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::tree_.

◆ setSearchSurface()

void pcl::Feature< PointInT, PointOutT >::setSearchSurface ( const PointCloudInConstPtr & cloud)
inline

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 149 of file feature.h.

References pcl::Feature< PointInT, PointOutT >::fake_surface_, and pcl::Feature< PointInT, PointOutT >::surface_.

Member Data Documentation

◆ fake_surface_

bool pcl::Feature< PointInT, PointOutT >::fake_surface_
protected

If no surface is given, we use the input PointCloud as the surface.

Definition at line 258 of file feature.h.

Referenced by pcl::Feature< PointInT, PointOutT >::setSearchSurface().

◆ feature_name_

std::string pcl::Feature< PointInT, PointOutT >::feature_name_
protected

The feature name.

Definition at line 223 of file feature.h.

Referenced by pcl::BOARDLocalReferenceFrameEstimation< PointInT, PointNT, PointOutT >::BOARDLocalReferenceFrameEstimation(), pcl::BoundaryEstimation< PointInT, PointNT, PointOutT >::BoundaryEstimation(), pcl::CPPFEstimation< PointInT, PointNT, PointOutT >::CPPFEstimation(), pcl::CRHEstimation< PointInT, PointNT, PointOutT >::CRHEstimation(), pcl::CVFHEstimation< PointInT, PointNT, PointOutT >::CVFHEstimation(), pcl::DifferenceOfNormalsEstimation< PointInT, PointNT, PointOutT >::DifferenceOfNormalsEstimation(), pcl::ESFEstimation< PointInT, PointOutT >::ESFEstimation(), pcl::FLARELocalReferenceFrameEstimation< PointInT, PointNT, PointOutT, SignedDistanceT >::FLARELocalReferenceFrameEstimation(), pcl::FPFHEstimation< PointInT, PointNT, PointOutT >::FPFHEstimation(), pcl::FPFHEstimationOMP< PointInT, PointNT, PointOutT >::FPFHEstimationOMP(), pcl::GASDColorEstimation< PointInT, PointOutT >::GASDColorEstimation(), pcl::GASDEstimation< PointInT, PointOutT >::GASDEstimation(), pcl::Feature< PointInT, PointOutT >::getClassName(), pcl::GFPFHEstimation< PointInT, PointLT, PointOutT >::GFPFHEstimation(), pcl::GRSDEstimation< PointInT, PointNT, PointOutT >::GRSDEstimation(), pcl::IntegralImageNormalEstimation< PointInT, PointOutT >::IntegralImageNormalEstimation(), pcl::IntensityGradientEstimation< PointInT, PointNT, PointOutT, IntensitySelectorT >::IntensityGradientEstimation(), pcl::IntensitySpinEstimation< PointInT, PointOutT >::IntensitySpinEstimation(), pcl::LinearLeastSquaresNormalEstimation< PointInT, PointOutT >::LinearLeastSquaresNormalEstimation(), pcl::MomentInvariantsEstimation< PointInT, PointOutT >::MomentInvariantsEstimation(), pcl::NormalEstimation< PointInT, PointOutT >::NormalEstimation(), pcl::NormalEstimationOMP< PointInT, PointOutT >::NormalEstimationOMP(), pcl::OURCVFHEstimation< PointInT, PointNT, PointOutT >::OURCVFHEstimation(), pcl::PFHEstimation< PointInT, PointNT, PointOutT >::PFHEstimation(), pcl::PFHRGBEstimation< PointInT, PointNT, PointOutT >::PFHRGBEstimation(), pcl::PPFEstimation< PointInT, PointNT, PointOutT >::PPFEstimation(), pcl::PPFRGBEstimation< PointInT, PointNT, PointOutT >::PPFRGBEstimation(), pcl::PPFRGBRegionEstimation< PointInT, PointNT, PointOutT >::PPFRGBRegionEstimation(), pcl::PrincipalCurvaturesEstimation< PointInT, PointNT, PointOutT >::PrincipalCurvaturesEstimation(), pcl::RIFTEstimation< PointInT, GradientT, PointOutT >::RIFTEstimation(), pcl::RSDEstimation< PointInT, PointNT, PointOutT >::RSDEstimation(), pcl::IntegralImageNormalEstimation< PointInT, PointOutT >::setNormalSmoothingSize(), pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::ShapeContext3DEstimation(), pcl::SHOTColorEstimation< PointInT, PointNT, PointOutT, PointRFT >::SHOTColorEstimation(), pcl::SHOTEstimation< PointInT, PointNT, PointOutT, PointRFT >::SHOTEstimation(), pcl::SHOTEstimationBase< PointInT, PointNT, PointOutT, PointRFT >::SHOTEstimationBase(), pcl::SHOTLocalReferenceFrameEstimation< PointInT, PointOutT >::SHOTLocalReferenceFrameEstimation(), pcl::SHOTLocalReferenceFrameEstimationOMP< PointInT, PointOutT >::SHOTLocalReferenceFrameEstimationOMP(), pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::SpinImageEstimation(), and pcl::UniqueShapeContext< PointInT, PointOutT, PointRFT >::UniqueShapeContext().

◆ k_

◆ search_method_surface_

SearchMethodSurface pcl::Feature< PointInT, PointOutT >::search_method_surface_
protected

The search method template for points.

Definition at line 226 of file feature.h.

Referenced by pcl::Feature< PointInT, PointOutT >::searchForNeighbors(), and pcl::Feature< PointInT, PointOutT >::searchForNeighbors().

◆ search_parameter_

double pcl::Feature< PointInT, PointOutT >::search_parameter_
protected

The actual search parameter (from either search_radius_ or k_).

Definition at line 237 of file feature.h.

Referenced by pcl::Feature< PointInT, PointOutT >::getSearchParameter().

◆ search_radius_

double pcl::Feature< PointInT, PointOutT >::search_radius_
protected

◆ surface_

An input point cloud describing the surface that is to be used for nearest neighbors estimation.

Definition at line 231 of file feature.h.

Referenced by pcl::Feature< PointInT, PointOutT >::getSearchSurface(), and pcl::Feature< PointInT, PointOutT >::setSearchSurface().

◆ tree_


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