39 #ifndef PCL_GPU_SEGMENTATION_IMPL_SEEDED_HUE_SEGMENTATION_H_
40 #define PCL_GPU_SEGMENTATION_IMPL_SEEDED_HUE_SEGMENTATION_H_
42 #include <pcl/gpu/segmentation/gpu_seeded_hue_segmentation.h>
49 PointIndices &indices_in,
50 PointIndices &indices_out,
56 std::vector<bool> processed (host_cloud_->
size (),
false);
58 const auto max_answers = host_cloud_->
size();
61 for (std::size_t k = 0; k < indices_in.indices.size (); ++k)
63 int i = indices_in.indices[k];
71 p = (*host_cloud_)[i];
80 queries_host.
push_back ((*host_cloud_)[i]);
82 unsigned int found_points = queries_host.
size ();
83 unsigned int previous_found_points = 0;
88 std::vector<int> sizes, data;
91 while (previous_found_points < found_points)
94 queries_device.
upload(queries_host);
96 tree->radiusSearch(queries_device, tolerance, max_answers, result_device);
99 previous_found_points = found_points;
102 sizes.clear (); data.clear ();
108 for(std::size_t qp = 0; qp < sizes.size (); qp++)
110 for(
int qp_r = 0; qp_r < sizes[qp]; qp_r++)
112 if(processed[data[qp_r + qp * max_answers]])
116 p_l = (*host_cloud_)[data[qp_r + qp * max_answers]];
120 if (std::abs(h_l.h - h.h) < delta_hue)
122 processed[data[qp_r + qp * max_answers]] =
true;
123 queries_host.
push_back ((*host_cloud_)[data[qp_r + qp * max_answers]]);
129 for(std::size_t qp = 0; qp < sizes.size (); qp++)
131 for(
int qp_r = 0; qp_r < sizes[qp]; qp_r++)
133 indices_out.indices.push_back(data[qp_r + qp * max_answers]);
150 if (!
tree_->isBuild())
165 #endif //PCL_GPU_SEGMENTATION_IMPL_SEEDED_HUE_SEGMENTATION_H_