61 std::vector<PointIndices>& clusters,
62 unsigned int min_pts_per_cluster,
63 unsigned int max_pts_per_cluster)
68 PCL_DEBUG(
"[pcl::gpu::extractEuclideanClusters]\n");
69 std::vector<bool> processed(host_cloud_->
size(),
false);
73 if (max_pts_per_cluster > host_cloud_->
size())
74 max_answers = host_cloud_->
size();
76 max_answers = max_pts_per_cluster;
77 PCL_DEBUG(
"Max_answers: %i\n", max_answers);
83 queries_device_buffer.
create(max_answers);
88 for (std::size_t i = 0; i < host_cloud_->
size(); ++i) {
111 unsigned int found_points = queries_host.
size();
112 unsigned int previous_found_points = 0;
120 if (queries_host.
size() <=
124 for (std::size_t p = 0; p < queries_host.
size(); p++) {
127 tree->radiusSearchHost(queries_host[p], tolerance, cpu_tmp, max_answers);
128 std::copy(cpu_tmp.begin(), cpu_tmp.end(), std::back_inserter(data));
139 queries_device.
upload(queries_host);
141 tree->radiusSearch(queries_device, tolerance, max_answers, result_device);
147 previous_found_points = found_points;
149 queries_host.
clear();
151 if (data.size() == 1)
155 for (
const auto& idx : data) {
158 processed[idx] =
true;
165 PCL_DEBUG(
" data.size: %i, foundpoints: %i, previous: %i",
168 previous_found_points);
169 PCL_DEBUG(
" new points: %i, next queries size: %i\n",
170 found_points - previous_found_points,
171 queries_host.
size());
172 }
while (previous_found_points < found_points);
174 if (found_points >= min_pts_per_cluster && found_points <= max_pts_per_cluster) {
181 clusters.push_back(r);
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)