41 #include <pcl/pcl_base.h> 43 #include <pcl/search/pcl_search.h> 83 template<
typename Po
intT>
100 condition_function_ (),
101 cluster_tolerance_ (0.0f),
102 min_cluster_size_ (1),
103 max_cluster_size_ (std::numeric_limits<int>::max ()),
104 extract_removed_clusters_ (extract_removed_clusters),
147 condition_function_ = condition_function;
155 condition_function_ = condition_function;
166 cluster_tolerance_ = cluster_tolerance;
173 return (cluster_tolerance_);
182 min_cluster_size_ = min_cluster_size;
189 return (min_cluster_size_);
198 max_cluster_size_ = max_cluster_size;
205 return (max_cluster_size_);
228 if (!extract_removed_clusters_)
230 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");
233 small_clusters = small_clusters_;
234 large_clusters = large_clusters_;
242 std::function<bool (const PointT&, const PointT&, float)> condition_function_;
245 float cluster_tolerance_;
248 int min_cluster_size_;
251 int max_cluster_size_;
254 bool extract_removed_clusters_;
267 #ifdef PCL_NO_PRECOMPILE 268 #include <pcl/segmentation/impl/conditional_euclidean_clustering.hpp> void setSearchMethod(const SearcherPtr &tree)
Provide a pointer to the search object.
void setMinClusterSize(int min_cluster_size)
Set the minimum number of points that a cluster needs to contain in order to be considered valid...
Defines functions, macros and traits for allocating and using memory.
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...
std::vector< pcl::PointIndices > IndicesClusters
typename pcl::search::Search< PointT >::Ptr SearcherPtr
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
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...
ConditionalEuclideanClustering performs segmentation based on Euclidean distance and a user-defined c...
shared_ptr< std::vector< pcl::PointIndices > > IndicesClustersPtr
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.
void setConditionFunction(std::function< bool(const PointT &, const PointT &, float)> condition_function)
Set the condition that needs to hold for neighboring points to be considered part of the same cluster...
shared_ptr< pcl::search::Search< PointT > > Ptr
A point structure representing Euclidean xyz coordinates, and the RGB color.
const SearcherPtr & getSearchMethod() const
Get a pointer to the search method used.
Defines all the PCL and non-PCL macros used.