Loading...
Searching...
No Matches
pcl::SpinImageEstimation< PointInT, PointNT, PointOutT > Class Template Reference
Module features

Estimates spin-image descriptors in the given input points. More...

`#include <pcl/features/spin_image.h>`

Inheritance diagram for pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >:

## Public Types

using | Ptr = shared_ptr<SpinImageEstimation<PointInT, PointNT, PointOutT> >
using | ConstPtr = shared_ptr<const SpinImageEstimation<PointInT, PointNT, PointOutT> >
using | PointCloudOut = typename Feature<PointInT, PointOutT>::PointCloudOut
using | PointCloudN = pcl::PointCloud<PointNT>
using | PointCloudNPtr = typename PointCloudN::Ptr
using | PointCloudNConstPtr = typename PointCloudN::ConstPtr
using | PointCloudIn = pcl::PointCloud<PointInT>
using | PointCloudInPtr = typename PointCloudIn::Ptr
using | PointCloudInConstPtr = typename PointCloudIn::ConstPtr
Public Types inherited from pcl::Feature< PointInT, PointOutT >
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

| SpinImageEstimation (unsigned int image_width=8, double support_angle_cos=0.0, unsigned int min_pts_neighb=0)
| Constructs empty spin image estimator.
| ~SpinImageEstimation () override=default
| Empty destructor.
void | setImageWidth (unsigned int bin_count)
| Sets spin-image resolution.
void | setSupportAngle (double support_angle_cos)
| Sets the maximum angle for the point normal to get to support region.
void | setMinPointCountInNeighbourhood (unsigned int min_pts_neighb)
| Sets minimal points count for spin image computation.
void | setInputNormals (const PointCloudNConstPtr &normals)
| Provide a pointer to the input dataset that contains the point normals of the input XYZ dataset given by setInputCloud.
void | setRotationAxis (const PointNT &axis)
| Sets single vector a rotation axis for all input points.
void | setInputRotationAxes (const PointCloudNConstPtr &axes)
| Sets array of vectors as rotation axes for input points.
void | useNormalsAsRotationAxis ()
| Sets input normals as rotation axes (default setting).
void | setAngularDomain (bool is_angular=true)
| Sets/unsets flag for angular spin-image domain.
void | setRadialStructure (bool is_radial=true)
| Sets/unsets flag for radial spin-image structure.
Public Member Functions inherited from pcl::Feature< PointInT, PointOutT >
| Feature ()
| Empty constructor.
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 PointInT & | operator[] (std::size_t pos) const
| Override PointCloud operator[] to shorten code.

## Protected Member Functions

void | computeFeature (PointCloudOut &output) override
| Estimate the Spin Image descriptors at a set of points given by setInputWithNormals() using the surface in setSearchSurfaceWithNormals() and the spatial locator.
bool | initCompute () override
| initializes computations specific to spin-image.
Eigen::ArrayXXd | computeSiForPoint (int index) const
| Computes a spin-image for the point of the scan.
Protected Member Functions inherited from pcl::Feature< PointInT, PointOutT >
const std::string & | getClassName () const
| Get a string representation of the name of this class.
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.

## Additional Inherited Members

Protected Attributes inherited from pcl::Feature< PointInT, PointOutT >
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 PointNT, typename PointOutT>
class pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >

Estimates spin-image descriptors in the given input points.

This class represents spin image descriptor. Spin image is a histogram of point locations summed along the bins of the image. A 2D accumulator indexed by a and b is created. Next, the coordinates (a, b) are computed for a vertex in the surface mesh that is within the support of the spin image (explained below). The bin indexed by (a, b) in the accumulator is then incremented; bilinear interpolation is used to smooth the contribution of the vertex. This procedure is repeated for all vertices within the support of the spin image. The resulting accumulator can be thought of as an image; dark areas in the image correspond to bins that contain many projected points. As long as the size of the bins in the accumulator is greater than the median distance between vertices in the mesh (the definition of mesh resolution), the position of individual vertices will be averaged out during spin image generation.

Attention
  The input normals given by setInputNormals have to match the input point cloud given by setInputCloud. This behavior is different than feature estimation methods that extend FeatureFromNormals, which match the normals with the search surface.

With the default parameters, pcl::Histogram<153> is a good choice for PointOutT. Of course the dimension of this descriptor must change to match the number of bins set by the parameters. If you use SpinImageEstimation with something other than pcl::Histogram<153>, you may need to put #define PCL_NO_PRECOMPILE 1 before including pcl/features/spin_image.h.

For further information please see:

- Johnson, A. E., & Hebert, M. (1998). Surface Matching for Object Recognition in Complex 3D Scenes. Image and Vision Computing, 16, 635-651.

The class also implements radial spin images and spin-images in angular domain (or both).

Author
  Roman Shapovalov, Alexander Velizhev

Definition at line 89 of file spin_image.h.

## Member Typedef Documentation

## ConstPtr

template<typename PointInT, typename PointNT, typename PointOutT>

using pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::ConstPtr = shared_ptr<const SpinImageEstimation<PointInT, PointNT, PointOutT> >

Definition at line 93 of file spin_image.h.

## PointCloudIn

template<typename PointInT, typename PointNT, typename PointOutT>

using pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::PointCloudIn = pcl::PointCloud<PointInT>

Definition at line 109 of file spin_image.h.

## PointCloudInConstPtr

template<typename PointInT, typename PointNT, typename PointOutT>

using pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::PointCloudInConstPtr = typename PointCloudIn::ConstPtr

Definition at line 111 of file spin_image.h.

## PointCloudInPtr

template<typename PointInT, typename PointNT, typename PointOutT>

using pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::PointCloudInPtr = typename PointCloudIn::Ptr

Definition at line 110 of file spin_image.h.

## PointCloudN

template<typename PointInT, typename PointNT, typename PointOutT>

using pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::PointCloudN = pcl::PointCloud<PointNT>

Definition at line 105 of file spin_image.h.

## PointCloudNConstPtr

template<typename PointInT, typename PointNT, typename PointOutT>

using pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::PointCloudNConstPtr = typename PointCloudN::ConstPtr

Definition at line 107 of file spin_image.h.

## PointCloudNPtr

template<typename PointInT, typename PointNT, typename PointOutT>

using pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::PointCloudNPtr = typename PointCloudN::Ptr

Definition at line 106 of file spin_image.h.

## PointCloudOut

template<typename PointInT, typename PointNT, typename PointOutT>

using pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::PointCloudOut = typename Feature<PointInT, PointOutT>::PointCloudOut

Definition at line 103 of file spin_image.h.

## Ptr

template<typename PointInT, typename PointNT, typename PointOutT>

using pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::Ptr = shared_ptr<SpinImageEstimation<PointInT, PointNT, PointOutT> >

Definition at line 92 of file spin_image.h.

## Constructor & Destructor Documentation

## SpinImageEstimation()

template<typename PointInT, typename PointNT, typename PointOutT>

pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::SpinImageEstimation | ( | unsigned int | image_width = 8,
|  | double | support_angle_cos = 0.0,
|  | unsigned int | min_pts_neighb = 0 )

Constructs empty spin image estimator.

Parameters

  [in] | image_width | spin-image resolution, number of bins along one dimension
  [in] | support_angle_cos | minimal allowed cosine of the angle between the normals of input point and search surface point for the point to be retained in the support
  [in] | min_pts_neighb | min number of points in the support to correctly estimate spin-image. If at some point the support contains less points, exception is thrown

Definition at line 52 of file spin_image.hpp.

References pcl::Feature< PointInT, PointOutT >::feature_name_, and setImageWidth().

## ~SpinImageEstimation()

template<typename PointInT, typename PointNT, typename PointOutT>

pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::~SpinImageEstimation | ( |  | ) |

override default

Empty destructor.

## Member Function Documentation

## computeFeature()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::computeFeature | ( | PointCloudOut & | output | ) |

override protected virtual

Estimate the Spin Image descriptors at a set of points given by setInputWithNormals() using the surface in setSearchSurfaceWithNormals() and the spatial locator.

Parameters

  [out] | output | the resultant point cloud that contains the Spin Image feature estimates

Implements pcl::Feature< PointInT, PointOutT >.

Definition at line 324 of file spin_image.hpp.

References computeSiForPoint(), and pcl::PCLBase< PointInT >::indices_.

## computeSiForPoint()

template<typename PointInT, typename PointNT, typename PointOutT>

Eigen::ArrayXXd pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::computeSiForPoint | ( | int | index | ) | const

protected

Computes a spin-image for the point of the scan.

Parameters

  [in] | index | the index of the reference point in the input cloud

Returns
  estimated spin-image (or its variant) as a matrix

Definition at line 69 of file spin_image.hpp.

References pcl::Feature< PointInT, PointOutT >::getClassName(), pcl::PCLBase< PointInT >::input_, M_PI, pcl::Feature< PointInT, PointOutT >::search_radius_, pcl::Feature< PointInT, PointOutT >::searchForNeighbors(), and pcl::Feature< PointInT, PointOutT >::surface_.

Referenced by computeFeature().

## initCompute()

template<typename PointInT, typename PointNT, typename PointOutT>

bool pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::initCompute | ( |  | ) |

override protected virtual

initializes computations specific to spin-image.

Returns
  true iff input data and initialization are correct

Reimplemented from pcl::Feature< PointInT, PointOutT >.

Definition at line 239 of file spin_image.hpp.

References pcl::Feature< PointInT, PointOutT >::deinitCompute(), pcl::Feature< PointInT, PointOutT >::fake_surface_, pcl::Feature< PointInT, PointOutT >::getClassName(), pcl::Feature< PointInT, PointOutT >::initCompute(), pcl::PCLBase< PointInT >::input_, pcl::Feature< PointInT, PointOutT >::k_, pcl::Feature< PointInT, PointOutT >::search_radius_, and pcl::Feature< PointInT, PointOutT >::surface_.

## setAngularDomain()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::setAngularDomain | ( | bool | is_angular = true | ) |

inline

Sets/unsets flag for angular spin-image domain.

Angular spin-image differs from the vanilla one in the way that not the points are collected in the bins but the angles between their normals and the normal to the reference point. For further information please see Endres, F., Plagemann, C., Stachniss, C., & Burgard, W. (2009). Unsupervised Discovery of Object Classes from Range Data using Latent Dirichlet Allocation. In Robotics: Science and Systems. Seattle, USA.

Parameters

  [in] | is_angular | true for angular domain, false for point domain

Definition at line 252 of file spin_image.h.

## setImageWidth()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::setImageWidth | ( | unsigned int | bin_count | ) |

inline

Sets spin-image resolution.

Parameters

  [in] | bin_count | spin-image resolution, number of bins along one dimension

Definition at line 134 of file spin_image.h.

Referenced by SpinImageEstimation().

## setInputNormals()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::setInputNormals | ( | const PointCloudNConstPtr & | normals | ) |

inline

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

Attention
  The input normals given by setInputNormals have to match the input point cloud given by setInputCloud. This behavior is different than feature estimation methods that extend FeatureFromNormals, which match the normals with the search surface.

Parameters

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

Definition at line 199 of file spin_image.h.

## setInputRotationAxes()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::setInputRotationAxes | ( | const PointCloudNConstPtr & | axes | ) |

inline

Sets array of vectors as rotation axes for input points.

Useful e.g. when one wants to use tangents instead of normals as rotation axes

Parameters

  [in] | axes | unit-length vectors that serves as rotation axes for the corresponding input points' reference frames

Definition at line 224 of file spin_image.h.

## setMinPointCountInNeighbourhood()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::setMinPointCountInNeighbourhood | ( | unsigned int | min_pts_neighb | ) |

inline

Sets minimal points count for spin image computation.

Parameters

  [in] | min_pts_neighb | min number of points in the support to correctly estimate spin-image. If at some point the support contains less points, exception is thrown

Definition at line 183 of file spin_image.h.

## setRadialStructure()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::setRadialStructure | ( | bool | is_radial = true | ) |

inline

Sets/unsets flag for radial spin-image structure.

Instead of rectangular coordinate system for reference frame polar coordinates are used. Binning is done depending on the distance and inclination angle from the reference point

Parameters

  [in] | is_radial | true for radial spin-image structure, false for rectangular

Definition at line 262 of file spin_image.h.

## setRotationAxis()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::setRotationAxis | ( | const PointNT & | axis | ) |

inline

Sets single vector a rotation axis for all input points.

It could be useful e.g. when the vertical axis is known.

Parameters

  [in] | axis | unit-length vector that serves as rotation axis for reference frame

Definition at line 210 of file spin_image.h.

## setSupportAngle()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::setSupportAngle | ( | double | support_angle_cos | ) |

inline

Sets the maximum angle for the point normal to get to support region.

Parameters

  [in] | support_angle_cos | minimal allowed cosine of the angle between the normals of input point and search surface point for the point to be retained in the support

Definition at line 166 of file spin_image.h.

## useNormalsAsRotationAxis()

template<typename PointInT, typename PointNT, typename PointOutT>

void pcl::SpinImageEstimation< PointInT, PointNT, PointOutT >::useNormalsAsRotationAxis | ( |  | ) |

inline

Sets input normals as rotation axes (default setting).

Definition at line 234 of file spin_image.h.

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

- pcl/features/spin_image.h
- pcl/features/impl/spin_image.hpp