pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT > Class Template Reference
Module features

ShapeContext3DEstimation implements the 3D shape context descriptor as described in: More...

`#include <pcl/features/3dsc.h>`

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

## Public Types

typedef boost::shared_ptr< ShapeContext3DEstimation< PointInT, PointNT, PointOutT > > | Ptr
typedef boost::shared_ptr< const ShapeContext3DEstimation< PointInT, PointNT, PointOutT > > | ConstPtr
typedef Feature< PointInT, PointOutT >::PointCloudOut | PointCloudOut
typedef Feature< PointInT, PointOutT >::PointCloudIn | PointCloudIn
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

| ShapeContext3DEstimation (bool random=false)
| Constructor. More...
virtual | ~ShapeContext3DEstimation ()
size_t | getAzimuthBins ()
size_t | getElevationBins ()
size_t | getRadiusBins ()
void | setMinimalRadius (double radius)
| The minimal radius value for the search sphere (rmin) in the original paper. More...
double | getMinimalRadius ()
void | setPointDensityRadius (double radius)
| This radius is used to compute local point density density = number of points within this radius. More...
double | getPointDensityRadius ()
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 ()
| Initialize computation by allocating all the intervals and the volume lookup table. More...
bool | computePoint (size_t index, const pcl::PointCloud< PointNT > &normals, float rf[9], std::vector< float > &desc)
| Estimate a descriptor for a given point. More...
void | computeFeature (PointCloudOut &output)
| Estimate the actual feature. More...
double | rnd ()
| Boost-based random number generator. 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

std::vector< float > | radii_interval_
| Values of the radii interval. More...
std::vector< float > | theta_divisions_
| Theta divisions interval. More...
std::vector< float > | phi_divisions_
| Phi divisions interval. More...
std::vector< float > | volume_lut_
| Volumes look up table. More...
size_t | azimuth_bins_
| Bins along the azimuth dimension. More...
size_t | elevation_bins_
| Bins along the elevation dimension. More...
size_t | radius_bins_
| Bins along the radius dimension. More...
double | min_radius_
| Minimal radius value. More...
double | point_density_radius_
| Point density radius. More...
size_t | descriptor_length_
| Descriptor length. More...
boost::mt19937 | rng_alg_
| Boost-based random number generator algorithm. More...
boost::shared_ptr< boost::uniform_01< boost::mt19937 > > | rng_
| Boost-based random number generator distribution. 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::ShapeContext1980>
class pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >

ShapeContext3DEstimation implements the 3D shape context descriptor as described in:

- Andrea Frome, Daniel Huber, Ravi Kolluri and Thomas Bülow, Jitendra Malik Recognizing Objects in Range Data Using Regional Point Descriptors, In proceedings of the 8th European Conference on Computer Vision (ECCV), Prague, May 11-14, 2004

The suggested PointOutT is pcl::ShapeContext1980

Attention
  The convention for a 3D shape context descriptor is:
  - if a query point's nearest neighbors cannot be estimated, the feature descriptor will be set to NaN (not a number), and the RF to 0
  - it is impossible to estimate a 3D shape context descriptor for a point that doesn't have finite 3D coordinates. Therefore, any point that contains NaN data on x, y, or z, will have its boundary feature property set to NaN.

Author
  Alessandro Franchi, Samuele Salti, Federico Tombari (original code)
  Nizar Sallem (port to PCL)

Definition at line 72 of file 3dsc.h.

## Member Typedef Documentation

## ConstPtr

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

typedef boost::shared_ptr<const ShapeContext3DEstimation<PointInT, PointNT, PointOutT> > pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::ConstPtr

Definition at line 76 of file 3dsc.h.

## PointCloudIn

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

typedef Feature<PointInT, PointOutT>::PointCloudIn pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::PointCloudIn

Definition at line 89 of file 3dsc.h.

## PointCloudOut

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

typedef Feature<PointInT, PointOutT>::PointCloudOut pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::PointCloudOut

Definition at line 88 of file 3dsc.h.

## Ptr

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

typedef boost::shared_ptr<ShapeContext3DEstimation<PointInT, PointNT, PointOutT> > pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::Ptr

Definition at line 75 of file 3dsc.h.

## Constructor & Destructor Documentation

## ShapeContext3DEstimation()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::ShapeContext3DEstimation | ( | bool | random = `false` | ) |

inline

Constructor.

Parameters

  [in] | random | If true the random seed is set to current time, else it is set to 12345 prior to computing the descriptor (used to select X axis)

Definition at line 95 of file 3dsc.h.

References pcl::Feature< PointInT, PointOutT >::feature_name_, pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::rng_, and pcl::Feature< PointInT, PointOutT >::search_radius_.

## ~ShapeContext3DEstimation()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

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

inline virtual

Definition at line 119 of file 3dsc.h.

## Member Function Documentation

## computeFeature()

template<typename PointInT , typename PointNT , typename PointOutT >

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

protected virtual

Estimate the actual feature.

Parameters

  [out] | output | the resultant feature

Implements pcl::Feature< PointInT, PointOutT >.

Definition at line 279 of file 3dsc.hpp.

References pcl::PointCloud< PointT >::is_dense, and pcl::isFinite().

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

## computePoint()

template<typename PointInT , typename PointNT , typename PointOutT >

bool pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::computePoint | ( | size_t | index,
|  | const pcl::PointCloud< PointNT > & | normals,
|  | float | rf[9],
|  | std::vector< float > & | desc
| ) |  |

protected

Estimate a descriptor for a given point.

Parameters

  [in] | index | the index of the point to estimate a descriptor for
  [in] | normals | a pointer to the set of normals
  [in] | rf | the reference frame
  [out] | desc | the resultant estimated descriptor

Returns
  true if the descriptor was computed successfully, false if there was an error (e.g. the nearest neighbor didn't return any neighbors)

–— Compute current neighbour polar coordinates –— Get distance between the neighbour and the origin

Project point into the tangent plane

Normalize to compute the dot product

Compute the angle between the projection and the x axis in the interval [0,360]

Compute the angle between the neighbour and the z axis (normal) in the interval [0, 180]

Accumulate w into correspondant Bin(j,k,l)

Definition at line 130 of file 3dsc.hpp.

References pcl::utils::equal(), pcl::geometry::project(), and pcl::rad2deg().

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

## getAzimuthBins()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

size_t pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::getAzimuthBins | ( |  | ) |

inline

Returns
  the number of bins along the azimuth

Definition at line 126 of file 3dsc.h.

References pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::azimuth_bins_.

## getElevationBins()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

size_t pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::getElevationBins | ( |  | ) |

inline

Returns
  The number of bins along the elevation

Definition at line 133 of file 3dsc.h.

References pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::elevation_bins_.

## getMinimalRadius()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

double pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::getMinimalRadius | ( |  | ) |

inline

Returns
  The minimal sphere radius

Definition at line 150 of file 3dsc.h.

References pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::min_radius_.

## getPointDensityRadius()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

double pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::getPointDensityRadius | ( |  | ) |

inline

Returns
  The point density search radius

Definition at line 161 of file 3dsc.h.

References pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::computeFeature(), pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::computePoint(), pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::initCompute(), and pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::point_density_radius_.

## getRadiusBins()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

size_t pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::getRadiusBins | ( |  | ) |

inline

Returns
  The number of bins along the radii direction

Definition at line 140 of file 3dsc.h.

References pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::radius_bins_.

## initCompute()

template<typename PointInT , typename PointNT , typename PointOutT >

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

protected virtual

Initialize computation by allocating all the intervals and the volume lookup table.

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

Definition at line 50 of file 3dsc.hpp.

References pcl::deg2rad().

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

## rnd()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

double pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::rnd | ( |  | ) |

inline protected

Boost-based random number generator.

Definition at line 231 of file 3dsc.h.

## setMinimalRadius()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

void pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::setMinimalRadius | ( | double | radius | ) |

inline

The minimal radius value for the search sphere (rmin) in the original paper.

Parameters

  [in] | radius | the desired minimal radius

Definition at line 146 of file 3dsc.h.

References pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::min_radius_.

## setPointDensityRadius()

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

void pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::setPointDensityRadius | ( | double | radius | ) |

inline

This radius is used to compute local point density density = number of points within this radius.

Parameters

  [in] | radius | value of the point density search radius

Definition at line 157 of file 3dsc.h.

References pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::point_density_radius_.

## Member Data Documentation

## azimuth_bins_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

size_t pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::azimuth_bins_

protected

Bins along the azimuth dimension.

Definition at line 198 of file 3dsc.h.

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

## descriptor_length_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

size_t pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::descriptor_length_

protected

Descriptor length.

Definition at line 213 of file 3dsc.h.

## elevation_bins_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

size_t pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::elevation_bins_

protected

Bins along the elevation dimension.

Definition at line 201 of file 3dsc.h.

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

## min_radius_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

double pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::min_radius_

protected

Minimal radius value.

Definition at line 207 of file 3dsc.h.

Referenced by pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::getMinimalRadius(), and pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::setMinimalRadius().

## phi_divisions_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

std::vector<float> pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::phi_divisions_

protected

Phi divisions interval.

Definition at line 192 of file 3dsc.h.

## point_density_radius_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

double pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::point_density_radius_

protected

Point density radius.

Definition at line 210 of file 3dsc.h.

Referenced by pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::getPointDensityRadius(), and pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::setPointDensityRadius().

## radii_interval_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

std::vector<float> pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::radii_interval_

protected

Values of the radii interval.

Definition at line 186 of file 3dsc.h.

## radius_bins_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

size_t pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::radius_bins_

protected

Bins along the radius dimension.

Definition at line 204 of file 3dsc.h.

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

## rng_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

boost::shared_ptr<boost::uniform_01<boost::mt19937> > pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::rng_

protected

Boost-based random number generator distribution.

Definition at line 219 of file 3dsc.h.

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

## rng_alg_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

boost::mt19937 pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::rng_alg_

protected

Boost-based random number generator algorithm.

Definition at line 216 of file 3dsc.h.

## theta_divisions_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

std::vector<float> pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::theta_divisions_

protected

Theta divisions interval.

Definition at line 189 of file 3dsc.h.

## volume_lut_

template<typename PointInT , typename PointNT , typename PointOutT = pcl::ShapeContext1980>

std::vector<float> pcl::ShapeContext3DEstimation< PointInT, PointNT, PointOutT >::volume_lut_

protected

Volumes look up table.

Definition at line 195 of file 3dsc.h.

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

- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/features/include/pcl/features/3dsc.h
- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/features/include/pcl/features/impl/3dsc.hpp