38 #include <pcl/search/search.h>
39 #include <pcl/pcl_base.h>
59 template <
typename Po
intT>
63 const typename search::Search<
PointT>::Ptr& tree,
65 std::vector<std::vector<PointIndices>>& labeled_clusters,
66 unsigned int min_pts_per_cluster,
67 unsigned int max_pts_per_cluster,
68 unsigned int max_label);
88 const typename search::Search<
PointT>::Ptr& tree,
90 std::vector<std::vector<PointIndices>>& labeled_clusters,
91 unsigned int min_pts_per_cluster = 1,
92 unsigned int max_pts_per_cluster = std::numeric_limits<
unsigned int>::max());
101 template <typename
PointT>
120 , cluster_tolerance_(0)
121 , min_pts_per_cluster_(1)
122 , max_pts_per_cluster_(std::numeric_limits<int>::max())
123 , max_label_(std::numeric_limits<int>::max()){};
148 cluster_tolerance_ = tolerance;
156 return (cluster_tolerance_);
165 min_pts_per_cluster_ = min_cluster_size;
173 return (min_pts_per_cluster_);
182 max_pts_per_cluster_ = max_cluster_size;
190 return (max_pts_per_cluster_);
198 setMaxLabels(
unsigned int max_label)
200 max_label_ = max_label;
215 extract(std::vector<std::vector<PointIndices>>& labeled_clusters);
219 using BasePCLBase::deinitCompute;
220 using BasePCLBase::indices_;
221 using BasePCLBase::initCompute;
222 using BasePCLBase::input_;
246 return (
"LabeledEuclideanClusterExtraction");
260 #ifdef PCL_NO_PRECOMPILE
261 #include <pcl/segmentation/impl/extract_labeled_clusters.hpp>
shared_ptr< KdTree< PointT > > Ptr
typename PointCloud::Ptr PointCloudPtr
typename PointCloud::ConstPtr PointCloudConstPtr
PointIndices::ConstPtr PointIndicesConstPtr
PointIndices::Ptr PointIndicesPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
void extractLabeledEuclideanClusters(const PointCloud< PointT > &cloud, const typename search::Search< PointT >::Ptr &tree, float tolerance, std::vector< std::vector< PointIndices >> &labeled_clusters, unsigned int min_pts_per_cluster, unsigned int max_pts_per_cluster, unsigned int max_label)
Decompose a region of space into clusters based on the Euclidean distance between points.
bool compareLabeledPointClusters(const pcl::PointIndices &a, const pcl::PointIndices &b)
Sort clusters method (for std::sort).
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major....
shared_ptr< ::pcl::PointIndices > Ptr
shared_ptr< const ::pcl::PointIndices > ConstPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.