40#ifndef PCL_RECOGNITION_GEOMETRIC_CONSISTENCY_IMPL_H_
41#define PCL_RECOGNITION_GEOMETRIC_CONSISTENCY_IMPL_H_
43#include <pcl/recognition/cg/geometric_consistency.h>
44#include <pcl/registration/correspondence_types.h>
45#include <pcl/registration/correspondence_rejection_sample_consensus.h>
46#include <pcl/common/io.h>
56template<
typename Po
intModelT,
typename Po
intSceneT>
void
60 found_transformations_.clear ();
62 if (!model_scene_corrs_)
65 "[pcl::GeometricConsistencyGrouping::clusterCorrespondences()] Error! Correspondences not set, please set them before calling again this function.\n");
76 std::vector<bool>
taken_corresps (model_scene_corrs_->size (),
false);
90 for (std::size_t i = 0; i < model_scene_corrs_->size (); ++i)
98 for (std::size_t j = 0; j < model_scene_corrs_->size (); ++j)
121 if (distance > gc_size_)
138 temp_corrs.push_back (model_scene_corrs_->at (j));
144 found_transformations_.push_back (
corr_rejector.getBestTransformation ());
152template<
typename Po
intModelT,
typename Po
intSceneT>
bool
154 std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f> > &
transformations)
161template<
typename Po
intModelT,
typename Po
intSceneT>
bool
166 if (!this->initCompute ())
169 "[pcl::GeometricConsistencyGrouping::recognize()] Error! Model cloud or Scene cloud not set, please set them before calling again this function.\n");
177 this->deinitCompute ();
181#define PCL_INSTANTIATE_GeometricConsistencyGrouping(T,ST) template class PCL_EXPORTS pcl::GeometricConsistencyGrouping<T,ST>;
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
std::size_t size() const
Size of the range the iterator is going through.
void clusterCorrespondences(std::vector< Correspondences > &model_instances) override
Cluster the input correspondences in order to distinguish between different instances of the model in...
typename PointCloud::Ptr PointCloudPtr
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.
CorrespondenceRejectorSampleConsensus implements a correspondence rejection using Random Sample Conse...
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
shared_ptr< Correspondences > CorrespondencesPtr
Correspondence represents a match between two entities (e.g., points, descriptors,...