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_
LabeledEuclideanClusterExtraction represents a segmentation class for cluster extraction in an Euclid...
virtual std::string getClassName() const
Class getName method.
KdTreePtr tree_
A pointer to the spatial search object.
boost::shared_ptr< pcl::search::Search< PointT > > Ptr
void setMaxLabels(unsigned int max_label)
Set the maximum number of labels in the cloud.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
pcl::PointCloud< PointT > PointCloud
KdTreePtr getSearchMethod() const
Get a pointer to the search method used.
int max_pts_per_cluster_
The maximum number of points that a cluster needs to contain in order to be considered valid (default...
void setMaxClusterSize(int max_cluster_size)
Set the maximum number of points that a cluster needs to contain in order to be considered valid...
boost::shared_ptr< PointCloud< PointT > > Ptr
IndicesPtr indices_
A pointer to the vector of point indices to use.
void setSearchMethod(const KdTreePtr &tree)
Provide a pointer to the search object.
pcl::search::Search< PointT > KdTree
double getClusterTolerance() const
Get the spatial cluster tolerance as a measure in the L2 Euclidean space.
bool initCompute()
This method should get called before starting the actual computation.
int getMaxClusterSize() const
Get the maximum number of points that a cluster needs to contain in order to be considered valid...
PointCloud::Ptr PointCloudPtr
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.
PointCloudConstPtr input_
The input point cloud dataset.
void extract(std::vector< std::vector< PointIndices > > &labeled_clusters)
Cluster extraction in a PointCloud given by
int getMinClusterSize() const
Get the minimum number of points that a cluster needs to contain in order to be considered valid...
pcl::search::Search< PointT >::Ptr KdTreePtr
bool deinitCompute()
This method should get called after finishing the actual computation.
double cluster_tolerance_
The spatial cluster tolerance as a measure in the L2 Euclidean space.
boost::shared_ptr< ::pcl::PointIndices > Ptr
LabeledEuclideanClusterExtraction()
Empty constructor.
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...
int min_pts_per_cluster_
The minimum number of points that a cluster needs to contain in order to be considered valid (default...
unsigned int max_label_
The maximum number of labels we can find in this pointcloud (default = MAXINT)
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< ::pcl::PointIndices const > ConstPtr
bool compareLabeledPointClusters(const pcl::PointIndices &a, const pcl::PointIndices &b)
Sort clusters method (for std::sort).
PointIndices::Ptr PointIndicesPtr
PointIndices::ConstPtr PointIndicesConstPtr