Point Cloud Library (PCL)
1.14.1-dev
|
Class implementing a 3D correspondence grouping enforcing geometric consistency among feature correspondences. More...
#include <pcl/recognition/cg/geometric_consistency.h>
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 = pcl::PointCloud< PointModelT > |
using | PointCloudPtr = typename PointCloud::Ptr |
using | PointCloudConstPtr = typename PointCloud::ConstPtr |
using | PointIndicesPtr = PointIndices::Ptr |
using | PointIndicesConstPtr = PointIndices::ConstPtr |
Public Member Functions | |
GeometricConsistencyGrouping ()=default | |
Constructor. More... | |
void | setGCThreshold (int threshold) |
Sets the minimum cluster size. More... | |
int | getGCThreshold () const |
Gets the minimum cluster size. More... | |
void | setGCSize (double gc_size) |
Sets the consensus set resolution. More... | |
double | getGCSize () const |
Gets the consensus set resolution. More... | |
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. More... | |
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. More... | |
Public Member Functions inherited from pcl::CorrespondenceGrouping< PointModelT, PointSceneT > | |
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 | |
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. More... | |
Protected Member Functions inherited from pcl::CorrespondenceGrouping< PointModelT, PointSceneT > | |
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 | |
int | gc_threshold_ {3} |
Minimum cluster size. More... | |
double | gc_size_ {1.0} |
Resolution of the consensus set used to cluster correspondences together. More... | |
std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f > > | found_transformations_ |
Transformations found by clusterCorrespondences method. More... | |
Protected Attributes inherited from pcl::CorrespondenceGrouping< PointModelT, PointSceneT > | |
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... | |
Class implementing a 3D correspondence grouping enforcing geometric consistency among feature correspondences.
Definition at line 54 of file geometric_consistency.h.
using pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::PointCloud = pcl::PointCloud<PointModelT> |
Definition at line 57 of file geometric_consistency.h.
using pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::PointCloudConstPtr = typename PointCloud::ConstPtr |
Definition at line 59 of file geometric_consistency.h.
using pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::PointCloudPtr = typename PointCloud::Ptr |
Definition at line 58 of file geometric_consistency.h.
using pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::SceneCloudConstPtr = typename pcl::CorrespondenceGrouping<PointModelT, PointSceneT>::SceneCloudConstPtr |
Definition at line 61 of file geometric_consistency.h.
|
default |
Constructor.
|
overrideprotectedvirtual |
Cluster the input correspondences in order to distinguish between different instances of the model into the scene.
[out] | model_instances | a vector containing the clustered correspondences for each model found on the scene. |
Implements pcl::CorrespondenceGrouping< PointModelT, PointSceneT >.
Definition at line 57 of file geometric_consistency.hpp.
References pcl::copyPointCloud(), pcl::geometry::distance(), pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getBestTransformation(), pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::getRemainingCorrespondences(), pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInlierThreshold(), pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputSource(), pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setInputTarget(), and pcl::registration::CorrespondenceRejectorSampleConsensus< PointT >::setMaximumIterations().
|
inline |
Gets the consensus set resolution.
Definition at line 100 of file geometric_consistency.h.
References pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::gc_size_.
|
inline |
Gets the minimum cluster size.
Definition at line 80 of file geometric_consistency.h.
References pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::gc_threshold_.
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.
[out] | transformations | a vector containing one transformation matrix for each instance of the model recognized into the scene. |
Definition at line 157 of file geometric_consistency.hpp.
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.
[out] | transformations | a vector containing one transformation matrix for each instance of the model recognized into the scene. |
[out] | clustered_corrs | a vector containing the correspondences for each instance of the model found within the input data (the same output of clusterCorrespondences). |
Definition at line 166 of file geometric_consistency.hpp.
|
inline |
Sets the consensus set resolution.
This should be in metric units.
[in] | gc_size | consensus set resolution. |
Definition at line 90 of file geometric_consistency.h.
References pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::gc_size_.
|
inline |
Sets the minimum cluster size.
[in] | threshold | the minimum cluster size |
Definition at line 70 of file geometric_consistency.h.
References pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::gc_threshold_.
|
protected |
Transformations found by clusterCorrespondences method.
Definition at line 136 of file geometric_consistency.h.
|
protected |
Resolution of the consensus set used to cluster correspondences together.
Definition at line 133 of file geometric_consistency.h.
Referenced by pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::getGCSize(), and pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::setGCSize().
|
protected |
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 130 of file geometric_consistency.h.
Referenced by pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::getGCThreshold(), and pcl::GeometricConsistencyGrouping< PointModelT, PointSceneT >::setGCThreshold().