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::GeometricConsistencyGrouping< PointModelT, PointSceneT > Class Template Reference

Class implementing a 3D correspondence grouping enforcing geometric consistency among feature correspondences. More...

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

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

Public Types

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

Public Member Functions

 GeometricConsistencyGrouping ()
 Constructor.
 
void setGCThreshold (int threshold)
 Sets the minimum cluster size.
 
int getGCThreshold () const
 Gets the minimum cluster size.
 
void setGCSize (double gc_size)
 Sets the consensus set resolution.
 
double getGCSize () const
 Gets the consensus set resolution.
 
bool recognize (std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > &transformations)
 The main function, recognizes instances of the model into the scene set by the user.
 
bool recognize (std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > &transformations, std::vector< pcl::Correspondences > &clustered_corrs)
 The main function, recognizes instances of the model into the scene set by the user.
 
- Public Member Functions inherited from pcl::CorrespondenceGrouping< PointModelT, PointSceneT >
 CorrespondenceGrouping ()
 Empty constructor.
 
 ~CorrespondenceGrouping ()
 destructor.
 
virtual void setSceneCloud (const SceneCloudConstPtr &scene)
 Provide a pointer to the scene dataset.
 
SceneCloudConstPtr getSceneCloud () const
 Getter for the scene dataset.
 
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.
 
CorrespondencesConstPtr getModelSceneCorrespondences () const
 Getter for the precomputed correspondences between points in the input dataset and points in the scene dataset.
 
std::vector< doublegetCharacteristicScales () const
 Getter for the vector of characteristic scales associated to each cluster.
 
void cluster (std::vector< Correspondences > &clustered_corrs)
 Clusters the input correspondences belonging to different model instances.
 
- Public Member Functions inherited from pcl::PCLBase< PointModelT >
 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 PointModelToperator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code.
 

Protected Member Functions

void clusterCorrespondences (std::vector< Correspondences > &model_instances) override
 Cluster the input correspondences in order to distinguish between different instances of the model into the scene.
 
- Protected Member Functions inherited from pcl::CorrespondenceGrouping< PointModelT, PointSceneT >
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 Member Functions inherited from pcl::PCLBase< PointModelT >
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

int gc_threshold_
 Minimum cluster size.
 
double gc_size_
 Resolution of the consensus set used to cluster correspondences together.
 
std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > found_transformations_
 Transformations found by clusterCorrespondences method.
 
- Protected Attributes inherited from pcl::CorrespondenceGrouping< PointModelT, PointSceneT >
SceneCloudConstPtr scene_
 The scene cloud.
 
CorrespondencesConstPtr model_scene_corrs_
 The correspondences between points in the input and the scene datasets.
 
std::vector< doublecorr_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.
 
- Protected Attributes inherited from pcl::PCLBase< PointModelT >
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 PointModelT, typename PointSceneT>
class pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >

Class implementing a 3D correspondence grouping enforcing geometric consistency among feature correspondences.

Author
Federico Tombari, Tommaso Cavallari, Aitor Aldoma

Definition at line 54 of file geometric_consistency.h.

Member Typedef Documentation

◆ PointCloud

Definition at line 57 of file geometric_consistency.h.

◆ PointCloudConstPtr

Definition at line 59 of file geometric_consistency.h.

◆ PointCloudPtr

Definition at line 58 of file geometric_consistency.h.

◆ SceneCloudConstPtr

Definition at line 61 of file geometric_consistency.h.

Constructor & Destructor Documentation

◆ GeometricConsistencyGrouping()

pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::GeometricConsistencyGrouping ( )
inline

Constructor.

Definition at line 64 of file geometric_consistency.h.

Member Function Documentation

◆ clusterCorrespondences()

void pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::clusterCorrespondences ( std::vector< Correspondences > & model_instances)
overrideprotectedvirtual

Cluster the input correspondences in order to distinguish between different instances of the model into the scene.

Parameters
[out]model_instancesa vector containing the clustered correspondences for each model found on the scene.
Returns
true if the clustering had been successful or false if errors have occurred.

Implements pcl::CorrespondenceGrouping< PointModelT, PointSceneT >.

Definition at line 57 of file geometric_consistency.hpp.

References pcl::ConstCloudIterator< PointT >::ConstCloudIterator(), pcl::copyPointCloud(), and pcl::ConstCloudIterator< PointT >::size().

◆ getGCSize()

Gets the consensus set resolution.

Returns
the consensus set resolution.

Definition at line 104 of file geometric_consistency.h.

References pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::gc_size_.

◆ getGCThreshold()

Gets the minimum cluster size.

Returns
the minimum cluster size used by GC.

Definition at line 84 of file geometric_consistency.h.

References pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::gc_threshold_.

◆ recognize() [1/2]

bool pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::recognize ( std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > & transformations)

The main function, recognizes instances of the model into the scene set by the user.

Parameters
[out]transformationsa vector containing one transformation matrix for each instance of the model recognized into the scene.
Returns
true if the recognition had been successful or false if errors have occurred.

Definition at line 153 of file geometric_consistency.hpp.

◆ recognize() [2/2]

bool pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::recognize ( std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > & transformations,
std::vector< pcl::Correspondences > & clustered_corrs )

The main function, recognizes instances of the model into the scene set by the user.

Parameters
[out]transformationsa vector containing one transformation matrix for each instance of the model recognized into the scene.
[out]clustered_corrsa vector containing the correspondences for each instance of the model found within the input data (the same output of clusterCorrespondences).
Returns
true if the recognition had been successful or false if errors have occurred.

Definition at line 162 of file geometric_consistency.hpp.

◆ setGCSize()

Sets the consensus set resolution.

This should be in metric units.

Parameters
[in]gc_sizeconsensus set resolution.

Definition at line 94 of file geometric_consistency.h.

References pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::gc_size_.

◆ setGCThreshold()

Sets the minimum cluster size.

Parameters
[in]thresholdthe minimum cluster size

Definition at line 74 of file geometric_consistency.h.

References pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::gc_threshold_.

Member Data Documentation

◆ found_transformations_

std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::found_transformations_
protected

Transformations found by clusterCorrespondences method.

Definition at line 140 of file geometric_consistency.h.

◆ gc_size_

Resolution of the consensus set used to cluster correspondences together.

Definition at line 137 of file geometric_consistency.h.

Referenced by pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::getGCSize(), and pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::setGCSize().

◆ gc_threshold_

Minimum cluster size.

It shouldn't be less than 3, since at least 3 correspondences are needed to compute the 6DOF pose

Definition at line 134 of file geometric_consistency.h.

Referenced by pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::getGCThreshold(), and pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::setGCThreshold().


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