38 #ifndef PCL_SEGMENTATION_CONDITIONAL_EUCLIDEAN_CLUSTERING_H_
39 #define PCL_SEGMENTATION_CONDITIONAL_EUCLIDEAN_CLUSTERING_H_
41 #include <pcl/pcl_base.h>
42 #include <pcl/search/pcl_search.h>
80 template<
typename Po
intT>
97 condition_function_ (),
98 cluster_tolerance_ (0.0f),
99 min_cluster_size_ (1),
100 max_cluster_size_ (
std::numeric_limits<int>::max ()),
101 extract_removed_clusters_ (extract_removed_clusters),
102 small_clusters_ (new
pcl::IndicesClusters),
103 large_clusters_ (new
pcl::IndicesClusters)
127 condition_function_ = condition_function;
138 cluster_tolerance_ = cluster_tolerance;
145 return (cluster_tolerance_);
154 min_cluster_size_ = min_cluster_size;
161 return (min_cluster_size_);
170 max_cluster_size_ = max_cluster_size;
177 return (max_cluster_size_);
190 segment (IndicesClusters &clusters);
200 if (!extract_removed_clusters_)
202 PCL_WARN(
"[pcl::ConditionalEuclideanClustering::getRemovedClusters] You need to set extract_removed_clusters to true (in this class' constructor) if you want to use this functionality.\n");
205 small_clusters = small_clusters_;
206 large_clusters = large_clusters_;
211 SearcherPtr searcher_;
214 bool (*condition_function_) (
const PointT&,
const PointT&, float);
217 float cluster_tolerance_;
220 int min_cluster_size_;
223 int max_cluster_size_;
226 bool extract_removed_clusters_;
235 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
239 #ifdef PCL_NO_PRECOMPILE
240 #include <pcl/segmentation/impl/conditional_euclidean_clustering.hpp>
243 #endif // PCL_SEGMENTATION_CONDITIONAL_EUCLIDEAN_CLUSTERING_H_
void setMinClusterSize(int min_cluster_size)
Set the minimum number of points that a cluster needs to contain in order to be considered valid...
void segment(IndicesClusters &clusters)
Segment the input into separate clusters.
int getMaxClusterSize()
Get the maximum number of points that a cluster needs to contain in order to be considered valid...
void setMaxClusterSize(int max_cluster_size)
Set the maximum number of points that a cluster needs to contain in order to be considered valid...
void setClusterTolerance(float cluster_tolerance)
Set the spatial tolerance for new cluster candidates.
void getRemovedClusters(IndicesClustersPtr &small_clusters, IndicesClustersPtr &large_clusters)
Get the clusters that are invalidated due to size constraints.
void setConditionFunction(bool(*condition_function)(const PointT &, const PointT &, float))
Set the condition that needs to hold for neighboring points to be considered part of the same cluster...
boost::shared_ptr< pcl::search::Search< PointT > > Ptr
ConditionalEuclideanClustering performs segmentation based on Euclidean distance and a user-defined c...
pcl::search::Search< PointT >::Ptr SearcherPtr
int getMinClusterSize()
Get the minimum number of points that a cluster needs to contain in order to be considered valid...
float getClusterTolerance()
Get the spatial tolerance for new cluster candidates.
ConditionalEuclideanClustering(bool extract_removed_clusters=false)
Constructor.
boost::shared_ptr< std::vector< pcl::PointIndices > > IndicesClustersPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
std::vector< pcl::PointIndices > IndicesClusters