36 #ifndef PCL_EXTRACT_LABELED_CLUSTERS_H_
37 #define PCL_EXTRACT_LABELED_CLUSTERS_H_
39 #include <pcl/pcl_base.h>
40 #include <pcl/search/pcl_search.h>
56 template <
typename Po
intT>
void
58 const PointCloud<PointT> &cloud,
const boost::shared_ptr<search::Search<PointT> > &tree,
59 float tolerance, std::vector<std::vector<PointIndices> > &labeled_clusters,
60 unsigned int min_pts_per_cluster = 1,
unsigned int max_pts_per_cluster = std::numeric_limits<unsigned int>::max (),
61 unsigned int max_label = std::numeric_limits<unsigned int>::max ());
70 template <
typename Po
intT>
150 extract (std::vector<std::vector<PointIndices> > &labeled_clusters);
175 virtual std::string
getClassName ()
const {
return (
"LabeledEuclideanClusterExtraction"); }
189 #ifdef PCL_NO_PRECOMPILE
190 #include <pcl/segmentation/impl/extract_labeled_clusters.hpp>
193 #endif //#ifndef PCL_EXTRACT_LABELED_CLUSTERS_H_
unsigned int getMaxLabels() const
Get the maximum number of labels.
void setClusterTolerance(double tolerance)
Set the spatial cluster tolerance as a measure in the L2 Euclidean space.
pcl::PointCloud< PointT > PointCloud
KdTreePtr getSearchMethod() const
Get a pointer to the search method used.
void extract(std::vector< std::vector< PointIndices > > &labeled_clusters)
Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>
int max_pts_per_cluster_
The maximum number of points that a cluster needs to contain in order to be considered valid (default...
LabeledEuclideanClusterExtraction represents a segmentation class for cluster extraction in an Euclid...
pcl::search::Search< PointT >::Ptr KdTreePtr
pcl::search::Search< PointT > KdTree
double getClusterTolerance() const
Get the spatial cluster tolerance as a measure in the L2 Euclidean space.
PointCloud::ConstPtr PointCloudConstPtr
virtual std::string getClassName() const
Class getName method.
PointIndices::ConstPtr PointIndicesConstPtr
KdTreePtr tree_
A pointer to the spatial search object.
boost::shared_ptr< ::pcl::PointIndices const > ConstPtr
boost::shared_ptr< ::pcl::PointIndices > Ptr
void setMaxClusterSize(int max_cluster_size)
Set the maximum number of points that a cluster needs to contain in order to be considered valid...
LabeledEuclideanClusterExtraction()
Empty constructor.
void setSearchMethod(const KdTreePtr &tree)
Provide a pointer to the search object.
void setMaxLabels(unsigned int max_label)
Set the maximum number of labels in the cloud.
PointCloud::Ptr PointCloudPtr
unsigned int max_label_
The maximum number of labels we can find in this pointcloud (default = MAXINT)
int getMinClusterSize() const
Get the minimum number of points that a cluster needs to contain in order to be considered valid...
boost::shared_ptr< pcl::search::Search< PointT > > Ptr
bool compareLabeledPointClusters(const pcl::PointIndices &a, const pcl::PointIndices &b)
Sort clusters method (for std::sort).
bool initCompute()
This method should get called before starting the actual computation.
boost::shared_ptr< PointCloud< PointT > > Ptr
double cluster_tolerance_
The spatial cluster tolerance as a measure in the L2 Euclidean space.
IndicesPtr indices_
A pointer to the vector of point indices to use.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
PointIndices::Ptr PointIndicesPtr
void extractLabeledEuclideanClusters(const PointCloud< PointT > &cloud, const boost::shared_ptr< search::Search< PointT > > &tree, float tolerance, std::vector< std::vector< PointIndices > > &labeled_clusters, unsigned int min_pts_per_cluster=1, unsigned int max_pts_per_cluster=std::numeric_limits< unsigned int >::max(), unsigned int max_label=std::numeric_limits< unsigned int >::max())
Decompose a region of space into clusters based on the Euclidean distance between points...
std::vector< int > indices
void setMinClusterSize(int min_cluster_size)
Set the minimum number of points that a cluster needs to contain in order to be considered valid...
PointCloudConstPtr input_
The input point cloud dataset.
bool deinitCompute()
This method should get called after finishing the actual computation.
int min_pts_per_cluster_
The minimum number of points that a cluster needs to contain in order to be considered valid (default...
int getMaxClusterSize() const
Get the maximum number of points that a cluster needs to contain in order to be considered valid...