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

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

#include <pcl/features/spin_image.h>

Inheritance diagram for pcl::SpinImageEstimation< PointInT, PointNT, Eigen::MatrixXf >:
Inheritance graph
[legend]
Collaboration diagram for pcl::SpinImageEstimation< PointInT, PointNT, Eigen::MatrixXf >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Feature< PointInT,
pcl::Histogram
< 153 > >::PointCloudOut 
PointCloudOut
typedef pcl::PointCloud< PointNT > PointCloudN
typedef PointCloudN::Ptr PointCloudNPtr
typedef PointCloudN::ConstPtr PointCloudNConstPtr
typedef pcl::PointCloud< PointInT > PointCloudIn
typedef PointCloudIn::Ptr PointCloudInPtr
typedef PointCloudIn::ConstPtr PointCloudInConstPtr
typedef boost::shared_ptr
< SpinImageEstimation
< PointInT, PointNT,
pcl::Histogram< 153 > > > 
Ptr
typedef boost::shared_ptr
< const SpinImageEstimation
< PointInT, PointNT,
pcl::Histogram< 153 > > > 
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

 SpinImageEstimation (unsigned int image_width=8, double support_angle_cos=0.0, unsigned int min_pts_neighb=0)
 Constructs empty spin image estimator.
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.
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>
class pcl::SpinImageEstimation< PointInT, PointNT, Eigen::MatrixXf >

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.

For further information please see:

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

Author:
Roman Shapovalov, Alexander Velizhev

Definition at line 316 of file spin_image.h.


Member Typedef Documentation

typedef PCLBase<PointInT> pcl::Feature< PointInT, pcl::Histogram< 153 > >::BaseClass [inherited]

Definition at line 110 of file feature.h.

typedef boost::shared_ptr<const SpinImageEstimation<PointInT, PointNT, pcl::Histogram< 153 > > > pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::ConstPtr [inherited]

Reimplemented from pcl::Feature< PointInT, pcl::Histogram< 153 > >.

Definition at line 110 of file spin_image.h.

typedef pcl::search::Search<PointInT> pcl::Feature< PointInT, pcl::Histogram< 153 > >::KdTree [inherited]

Definition at line 115 of file feature.h.

typedef pcl::search::Search<PointInT>::Ptr pcl::Feature< PointInT, pcl::Histogram< 153 > >::KdTreePtr [inherited]

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]
typedef pcl::PointCloud<PointInT> pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::PointCloudIn [inherited]

Reimplemented from pcl::Feature< PointInT, pcl::Histogram< 153 > >.

Definition at line 105 of file spin_image.h.

typedef PointCloudIn::ConstPtr pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::PointCloudInConstPtr [inherited]

Reimplemented from pcl::Feature< PointInT, pcl::Histogram< 153 > >.

Definition at line 107 of file spin_image.h.

typedef PointCloudIn::Ptr pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::PointCloudInPtr [inherited]

Reimplemented from pcl::Feature< PointInT, pcl::Histogram< 153 > >.

Definition at line 106 of file spin_image.h.

typedef pcl::PointCloud<PointNT> pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::PointCloudN [inherited]

Definition at line 101 of file spin_image.h.

typedef PointCloudN::ConstPtr pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::PointCloudNConstPtr [inherited]

Definition at line 103 of file spin_image.h.

typedef PointCloudN::Ptr pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::PointCloudNPtr [inherited]

Definition at line 102 of file spin_image.h.

typedef Feature<PointInT, pcl::Histogram< 153 > >::PointCloudOut pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::PointCloudOut [inherited]

Reimplemented from pcl::Feature< PointInT, pcl::Histogram< 153 > >.

Definition at line 99 of file spin_image.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.

typedef boost::shared_ptr<SpinImageEstimation<PointInT, PointNT, pcl::Histogram< 153 > > > pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::Ptr [inherited]

Reimplemented from pcl::Feature< PointInT, pcl::Histogram< 153 > >.

Definition at line 109 of file spin_image.h.

typedef boost::function<int (size_t, double, std::vector<int> &, std::vector<float> &)> pcl::Feature< PointInT, pcl::Histogram< 153 > >::SearchMethod [inherited]

Definition at line 124 of file feature.h.

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

Definition at line 125 of file feature.h.


Constructor & Destructor Documentation

template<typename PointInT , typename PointNT >
pcl::SpinImageEstimation< PointInT, PointNT, Eigen::MatrixXf >::SpinImageEstimation ( unsigned int  image_width = 8,
double  support_angle_cos = 0.0,
unsigned int  min_pts_neighb = 0 
) [inline]

Constructs empty spin image estimator.

Parameters:
[in]image_widthspin-image resolution, number of bins along one dimension
[in]support_angle_cosminimal 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_neighbmin number of points in the support to correctly estimate spin-image. If at some point the support contains less points, exception is thrown

Reimplemented from pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >.

Definition at line 335 of file spin_image.h.


Member Function Documentation

void pcl::Feature< PointInT, pcl::Histogram< 153 > >::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
void pcl::Feature< PointInT, pcl::Histogram< 153 > >::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
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.

int pcl::Feature< PointInT, pcl::Histogram< 153 > >::getKSearch ( ) const [inline, inherited]

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

Definition at line 186 of file feature.h.

double pcl::Feature< PointInT, pcl::Histogram< 153 > >::getRadiusSearch ( ) const [inline, inherited]

Get the sphere radius used for determining the neighbors.

Definition at line 203 of file feature.h.

KdTreePtr pcl::Feature< PointInT, pcl::Histogram< 153 > >::getSearchMethod ( ) const [inline, inherited]

Get a pointer to the search method used.

Definition at line 166 of file feature.h.

double pcl::Feature< PointInT, pcl::Histogram< 153 > >::getSearchParameter ( ) const [inline, inherited]

Get the internal search parameter.

Definition at line 173 of file feature.h.

PointCloudInConstPtr pcl::Feature< PointInT, pcl::Histogram< 153 > >::getSearchSurface ( ) const [inline, inherited]

Get a pointer to the surface point cloud dataset.

Definition at line 153 of file feature.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::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::setAngularDomain ( bool  is_angular = true) [inline, inherited]

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_angulartrue for angular domain, false for point domain

Definition at line 228 of file spin_image.h.

void pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::setImageWidth ( unsigned int  bin_count) [inline, inherited]

Sets spin-image resolution.

Parameters:
[in]bin_countspin-image resolution, number of bins along one dimension

Definition at line 130 of file spin_image.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.

void pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::setInputNormals ( const PointCloudNConstPtr normals) [inline, inherited]

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]normalsthe const boost shared pointer to a PointCloud of normals. By convention, L2 norm of each normal should be 1.

Definition at line 175 of file spin_image.h.

void pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::setInputRotationAxes ( const PointCloudNConstPtr axes) [inline, inherited]

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]axesunit-length vectors that serves as rotation axes for the corresponding input points' reference frames

Definition at line 200 of file spin_image.h.

void pcl::Feature< PointInT, pcl::Histogram< 153 > >::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

Definition at line 182 of file feature.h.

void pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::setMinPointCountInNeighbourhood ( unsigned int  min_pts_neighb) [inline, inherited]

Sets minimal points count for spin image computation.

Parameters:
[in]min_pts_neighbmin 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 159 of file spin_image.h.

void pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::setRadialStructure ( bool  is_radial = true) [inline, inherited]

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_radialtrue for radial spin-image structure, false for rectangular

Definition at line 238 of file spin_image.h.

void pcl::Feature< PointInT, pcl::Histogram< 153 > >::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.

void pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::setRotationAxis ( const PointNT &  axis) [inline, inherited]

Sets single vector a rotation axis for all input points.

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

Parameters:
[in]axisunit-length vector that serves as rotation axis for reference frame

Definition at line 186 of file spin_image.h.

void pcl::Feature< PointInT, pcl::Histogram< 153 > >::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.

void pcl::Feature< PointInT, pcl::Histogram< 153 > >::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.

void pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::setSupportAngle ( double  support_angle_cos) [inline, inherited]

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

Parameters:
[in]support_angle_cosminimal 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 142 of file spin_image.h.

void pcl::SpinImageEstimation< PointInT, PointNT, pcl::Histogram< 153 > >::useNormalsAsRotationAxis ( ) [inline, inherited]

Sets input normals as rotation axes (default setting).

Definition at line 210 of file spin_image.h.


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