62 std::vector<PointIndices>& clusters,
63 unsigned int min_pts_per_cluster,
64 unsigned int max_pts_per_cluster)
69 PCL_DEBUG(
"[pcl::gpu::extractEuclideanClusters]\n");
70 std::vector<bool> processed(host_cloud_->
size(),
false);
74 if (max_pts_per_cluster > host_cloud_->
size())
75 max_answers = host_cloud_->
size();
77 max_answers = max_pts_per_cluster;
78 PCL_DEBUG(
"Max_answers: %i\n", max_answers);
84 queries_device_buffer.
create(max_answers);
89 for (std::size_t i = 0; i < host_cloud_->
size(); ++i) {
112 unsigned int found_points = queries_host.
size();
113 unsigned int previous_found_points = 0;
121 if (queries_host.
size() <=
125 for (std::size_t p = 0; p < queries_host.
size(); p++) {
128 tree->radiusSearchHost(queries_host[p], tolerance, cpu_tmp, max_answers);
129 std::copy(cpu_tmp.begin(), cpu_tmp.end(), std::back_inserter(data));
140 queries_device.
upload(queries_host);
142 tree->radiusSearch(queries_device, tolerance, max_answers, result_device);
148 previous_found_points = found_points;
150 queries_host.
clear();
152 if (data.size() == 1)
156 for (
const auto& idx : data) {
159 processed[idx] =
true;
166 PCL_DEBUG(
" data.size: %i, foundpoints: %i, previous: %i",
169 previous_found_points);
170 PCL_DEBUG(
" new points: %i, next queries size: %i\n",
171 found_points - previous_found_points,
172 queries_host.
size());
173 }
while (previous_found_points < found_points);
175 if (found_points >= min_pts_per_cluster && found_points <= max_pts_per_cluster) {
182 clusters.push_back(r);
PCL_EXPORTS void economical_download(const pcl::gpu::NeighborIndices &source_indices, const pcl::Indices &buffer_indices, std::size_t buffer_size, pcl::Indices &downloaded_indices)
void extractEuclideanClusters(const typename pcl::PointCloud< PointT >::Ptr &host_cloud_, const pcl::gpu::Octree::Ptr &tree, float tolerance, std::vector< PointIndices > &clusters, unsigned int min_pts_per_cluster, unsigned int max_pts_per_cluster)