Point Cloud Library (PCL)  1.14.0-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::CorrespondenceGrouping< PointModelT, PointSceneT > Class Template Referenceabstract

Abstract base class for Correspondence Grouping algorithms. More...

#include <pcl/recognition/cg/correspondence_grouping.h>

+ Inheritance diagram for pcl::CorrespondenceGrouping< PointModelT, PointSceneT >:
+ Collaboration diagram for pcl::CorrespondenceGrouping< PointModelT, PointSceneT >:

Public Types

using SceneCloud = pcl::PointCloud< PointSceneT >
 
using SceneCloudPtr = typename SceneCloud::Ptr
 
using SceneCloudConstPtr = typename SceneCloud::ConstPtr
 
- Public Types inherited from pcl::PCLBase< PointModelT >
using PointCloud = pcl::PointCloud< PointModelT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
using PointIndicesPtr = PointIndices::Ptr
 
using PointIndicesConstPtr = PointIndices::ConstPtr
 

Public Member Functions

 CorrespondenceGrouping ()
 Empty constructor. More...
 
 ~CorrespondenceGrouping () override
 destructor. More...
 
virtual void setSceneCloud (const SceneCloudConstPtr &scene)
 Provide a pointer to the scene dataset. More...
 
SceneCloudConstPtr getSceneCloud () const
 Getter for the scene dataset. More...
 
virtual void setModelSceneCorrespondences (const CorrespondencesConstPtr &corrs)
 Provide a pointer to the precomputed correspondences between points in the input dataset and points in the scene dataset. More...
 
CorrespondencesConstPtr getModelSceneCorrespondences () const
 Getter for the precomputed correspondences between points in the input dataset and points in the scene dataset. More...
 
std::vector< double > getCharacteristicScales () const
 Getter for the vector of characteristic scales associated to each cluster. More...
 
void cluster (std::vector< Correspondences > &clustered_corrs)
 Clusters the input correspondences belonging to different model instances. More...
 
- Public Member Functions inherited from pcl::PCLBase< PointModelT >
 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 PointModelT & operator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Protected Member Functions

virtual void clusterCorrespondences (std::vector< Correspondences > &clustered_corrs)=0
 The actual clustering method, should be implemented by each subclass. 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 Member Functions inherited from pcl::PCLBase< PointModelT >
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

SceneCloudConstPtr scene_
 The scene cloud. More...
 
CorrespondencesConstPtr model_scene_corrs_
 The correspondences between points in the input and the scene datasets. More...
 
std::vector< double > corr_group_scale_
 characteristic scale associated to each correspondence subset; if the cg algorithm can not handle scale invariance, the size of the vector will be 0. More...
 
- Protected Attributes inherited from pcl::PCLBase< PointModelT >
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 PointModelT, typename PointSceneT>
class pcl::CorrespondenceGrouping< PointModelT, PointSceneT >

Abstract base class for Correspondence Grouping algorithms.

Author
Tommaso Cavallari, Federico Tombari, Aitor Aldoma

Definition at line 54 of file correspondence_grouping.h.

Member Typedef Documentation

◆ SceneCloud

template<typename PointModelT , typename PointSceneT >
using pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::SceneCloud = pcl::PointCloud<PointSceneT>

Definition at line 57 of file correspondence_grouping.h.

◆ SceneCloudConstPtr

template<typename PointModelT , typename PointSceneT >
using pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::SceneCloudConstPtr = typename SceneCloud::ConstPtr

Definition at line 59 of file correspondence_grouping.h.

◆ SceneCloudPtr

template<typename PointModelT , typename PointSceneT >
using pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::SceneCloudPtr = typename SceneCloud::Ptr

Definition at line 58 of file correspondence_grouping.h.

Constructor & Destructor Documentation

◆ CorrespondenceGrouping()

template<typename PointModelT , typename PointSceneT >
pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::CorrespondenceGrouping ( )
inline

Empty constructor.

Definition at line 62 of file correspondence_grouping.h.

◆ ~CorrespondenceGrouping()

template<typename PointModelT , typename PointSceneT >
pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::~CorrespondenceGrouping ( )
inlineoverride

Member Function Documentation

◆ cluster()

template<typename PointModelT , typename PointSceneT >
void pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::cluster ( std::vector< Correspondences > &  clustered_corrs)

Clusters the input correspondences belonging to different model instances.

Parameters
[out]clustered_corrsa vector containing the correspondences for each instance of the model found within the input data.

Definition at line 49 of file correspondence_grouping.hpp.

◆ clusterCorrespondences()

template<typename PointModelT , typename PointSceneT >
virtual void pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::clusterCorrespondences ( std::vector< Correspondences > &  clustered_corrs)
protectedpure virtual

The actual clustering method, should be implemented by each subclass.

Parameters
[out]clustered_corrsa vector containing the correspondences for each instance of the model found within the input data.

Implemented in pcl::Hough3DGrouping< PointModelT, PointSceneT, PointModelRfT, PointSceneRfT >, and pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >.

◆ deinitCompute()

template<typename PointModelT , typename PointSceneT >
bool pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::deinitCompute ( )
inlineprotected

This method should get called after finishing the actual computation.

Definition at line 191 of file correspondence_grouping.h.

◆ getCharacteristicScales()

template<typename PointModelT , typename PointSceneT >
std::vector<double> pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::getCharacteristicScales ( ) const
inline

Getter for the vector of characteristic scales associated to each cluster.

Returns
the vector of characteristic scales (assuming scale = model / scene)

Definition at line 119 of file correspondence_grouping.h.

References pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::corr_group_scale_.

◆ getModelSceneCorrespondences()

template<typename PointModelT , typename PointSceneT >
CorrespondencesConstPtr pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::getModelSceneCorrespondences ( ) const
inline

Getter for the precomputed correspondences between points in the input dataset and points in the scene dataset.

Returns
the correspondences between the model and the scene.

Definition at line 109 of file correspondence_grouping.h.

References pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::model_scene_corrs_.

◆ getSceneCloud()

template<typename PointModelT , typename PointSceneT >
SceneCloudConstPtr pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::getSceneCloud ( ) const
inline

Getter for the scene dataset.

Returns
the const boost shared pointer to a PointCloud message.

Definition at line 86 of file correspondence_grouping.h.

References pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::scene_.

◆ initCompute()

template<typename PointModelT , typename PointSceneT >
bool pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::initCompute ( )
inlineprotected

This method should get called before starting the actual computation.

Internally, initCompute() does the following:

  • checks if an input dataset is given, and returns false otherwise
  • checks if a scene dataset is given, and returns false otherwise
  • checks if the model-scene correspondences have been given, and returns false otherwise

Definition at line 159 of file correspondence_grouping.h.

References pcl::PCLBase< PointModelT >::input_, pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::model_scene_corrs_, and pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::scene_.

◆ setModelSceneCorrespondences()

template<typename PointModelT , typename PointSceneT >
virtual void pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::setModelSceneCorrespondences ( const CorrespondencesConstPtr corrs)
inlinevirtual

Provide a pointer to the precomputed correspondences between points in the input dataset and points in the scene dataset.

The correspondences are going to be clustered into different model hypotheses by the algorithm.

Parameters
[in]corrsthe correspondences between the model and the scene.

Reimplemented in pcl::Hough3DGrouping< PointModelT, PointSceneT, PointModelRfT, PointSceneRfT >.

Definition at line 98 of file correspondence_grouping.h.

References pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::model_scene_corrs_.

◆ setSceneCloud()

template<typename PointModelT , typename PointSceneT >
virtual void pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::setSceneCloud ( const SceneCloudConstPtr scene)
inlinevirtual

Provide a pointer to the scene dataset.

Parameters
[in]scenethe const boost shared pointer to a PointCloud message.

Reimplemented in pcl::Hough3DGrouping< PointModelT, PointSceneT, PointModelRfT, PointSceneRfT >.

Definition at line 76 of file correspondence_grouping.h.

References pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::scene_.

Member Data Documentation

◆ corr_group_scale_

template<typename PointModelT , typename PointSceneT >
std::vector<double> pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::corr_group_scale_
protected

characteristic scale associated to each correspondence subset; if the cg algorithm can not handle scale invariance, the size of the vector will be 0.

Definition at line 142 of file correspondence_grouping.h.

Referenced by pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::getCharacteristicScales().

◆ model_scene_corrs_

template<typename PointModelT , typename PointSceneT >
CorrespondencesConstPtr pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::model_scene_corrs_
protected

◆ scene_

template<typename PointModelT , typename PointSceneT >
SceneCloudConstPtr pcl::CorrespondenceGrouping< PointModelT, PointSceneT >::scene_
protected

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