37#ifndef PCL_SEGMENTATION_IMPL_EXTRACT_LABELED_CLUSTERS_H_
38#define PCL_SEGMENTATION_IMPL_EXTRACT_LABELED_CLUSTERS_H_
40#include <pcl/segmentation/extract_labeled_clusters.h>
43template <
typename Po
intT>
62template <
typename Po
intT>
72 if (tree->getInputCloud()->size() != cloud.
size()) {
73 PCL_ERROR(
"[pcl::extractLabeledEuclideanClusters] Tree built for a different point "
74 "cloud dataset (%lu) than the input cloud (%lu)!\n",
75 tree->getInputCloud()->size(),
102 std::numeric_limits<int>::max());
104 PCL_ERROR(
"radiusSearch on tree came back with error -1");
115 if (cloud[i].label == cloud[
nn_indices[j]].label) {
146template <
typename Po
intT>
151 if (!initCompute() || (input_ && input_->empty()) ||
152 (indices_ && indices_->empty())) {
159 if (input_->isOrganized())
166 tree_->setInputCloud(input_);
169 static_cast<float>(cluster_tolerance_),
171 min_pts_per_cluster_,
172 max_pts_per_cluster_);
181#define PCL_INSTANTIATE_LabeledEuclideanClusterExtraction(T) \
182 template class PCL_EXPORTS pcl::LabeledEuclideanClusterExtraction<T>;
183#define PCL_INSTANTIATE_extractLabeledEuclideanClusters_deprecated(T) \
184 template void PCL_EXPORTS pcl::extractLabeledEuclideanClusters<T>( \
185 const pcl::PointCloud<T>&, \
186 const typename pcl::search::Search<T>::Ptr&, \
188 std::vector<std::vector<pcl::PointIndices>>&, \
192#define PCL_INSTANTIATE_extractLabeledEuclideanClusters(T) \
193 template void PCL_EXPORTS pcl::extractLabeledEuclideanClusters<T>( \
194 const pcl::PointCloud<T>&, \
195 const typename pcl::search::Search<T>::Ptr&, \
197 std::vector<std::vector<pcl::PointIndices>>&, \
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
std::size_t size() const
Size of the range the iterator is going through.
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
OrganizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds.
shared_ptr< pcl::search::Search< PointT > > Ptr
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 comparePointClusters(const pcl::PointIndices &a, const pcl::PointIndices &b)
Sort clusters method (for std::sort).
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
IndicesAllocator<> Indices
Type used for indices in PCL.