Point Cloud Library (PCL)  1.11.1-dev
extract_clusters.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2011, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of the copyright holder(s) nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * $Id$
37  *
38  */
39 
40 #pragma once
41 
42 #include <pcl/console/print.h> // for PCL_ERROR
43 #include <pcl/pcl_base.h>
44 
45 #include <pcl/search/search.h> // for Search
46 #include <pcl/search/kdtree.h> // for KdTree
47 
48 namespace pcl
49 {
50  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
51  /** \brief Decompose a region of space into clusters based on the Euclidean distance between points
52  * \param cloud the point cloud message
53  * \param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
54  * \note the tree has to be created as a spatial locator on \a cloud
55  * \param tolerance the spatial cluster tolerance as a measure in L2 Euclidean space
56  * \param clusters the resultant clusters containing point indices (as a vector of PointIndices)
57  * \param min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
58  * \param max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
59  * \ingroup segmentation
60  */
61  template <typename PointT> void
63  const PointCloud<PointT> &cloud, const typename search::Search<PointT>::Ptr &tree,
64  float tolerance, std::vector<PointIndices> &clusters,
65  unsigned int min_pts_per_cluster = 1, unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ());
66 
67  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
68  /** \brief Decompose a region of space into clusters based on the Euclidean distance between points
69  * \param cloud the point cloud message
70  * \param indices a list of point indices to use from \a cloud
71  * \param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
72  * \note the tree has to be created as a spatial locator on \a cloud and \a indices
73  * \param tolerance the spatial cluster tolerance as a measure in L2 Euclidean space
74  * \param clusters the resultant clusters containing point indices (as a vector of PointIndices)
75  * \param min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
76  * \param max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
77  * \ingroup segmentation
78  */
79  template <typename PointT> void
81  const PointCloud<PointT> &cloud, const Indices &indices,
82  const typename search::Search<PointT>::Ptr &tree, float tolerance, std::vector<PointIndices> &clusters,
83  unsigned int min_pts_per_cluster = 1, unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ());
84 
85  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
86  /** \brief Decompose a region of space into clusters based on the euclidean distance between points, and the normal
87  * angular deviation between points. Each point added to the cluster is origin to another radius search. Each point
88  * within radius range will be compared to the origin in respect to normal angle and euclidean distance. If both
89  * are under their respective threshold the point will be added to the cluster. Generally speaking the cluster
90  * algorithm will not stop on smooth surfaces but on surfaces with sharp edges.
91  * \param cloud the point cloud message
92  * \param normals the point cloud message containing normal information
93  * \param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
94  * \note the tree has to be created as a spatial locator on \a cloud
95  * \param tolerance the spatial cluster tolerance as a measure in the L2 Euclidean space
96  * \param clusters the resultant clusters containing point indices (as a vector of PointIndices)
97  * \param eps_angle the maximum allowed difference between normals in radians for cluster/region growing
98  * \param min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
99  * \param max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
100  * \ingroup segmentation
101  */
102  template <typename PointT, typename Normal> void
104  const PointCloud<PointT> &cloud, const PointCloud<Normal> &normals,
105  float tolerance, const typename KdTree<PointT>::Ptr &tree,
106  std::vector<PointIndices> &clusters, double eps_angle,
107  unsigned int min_pts_per_cluster = 1,
108  unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ())
109  {
110  if (tree->getInputCloud ()->size () != cloud.size ())
111  {
112  PCL_ERROR("[pcl::extractEuclideanClusters] Tree built for a different point "
113  "cloud dataset (%zu) than the input cloud (%zu)!\n",
114  static_cast<std::size_t>(tree->getInputCloud()->size()),
115  static_cast<std::size_t>(cloud.size()));
116  return;
117  }
118  if (cloud.size () != normals.size ())
119  {
120  PCL_ERROR("[pcl::extractEuclideanClusters] Number of points in the input point "
121  "cloud (%zu) different than normals (%zu)!\n",
122  static_cast<std::size_t>(cloud.size()),
123  static_cast<std::size_t>(normals.size()));
124  return;
125  }
126 
127  // Create a bool vector of processed point indices, and initialize it to false
128  std::vector<bool> processed (cloud.size (), false);
129 
130  Indices nn_indices;
131  std::vector<float> nn_distances;
132  // Process all points in the indices vector
133  for (std::size_t i = 0; i < cloud.size (); ++i)
134  {
135  if (processed[i])
136  continue;
137 
138  Indices seed_queue;
139  int sq_idx = 0;
140  seed_queue.push_back (static_cast<index_t> (i));
141 
142  processed[i] = true;
143 
144  while (sq_idx < static_cast<int> (seed_queue.size ()))
145  {
146  // Search for sq_idx
147  if (!tree->radiusSearch (seed_queue[sq_idx], tolerance, nn_indices, nn_distances))
148  {
149  sq_idx++;
150  continue;
151  }
152 
153  for (std::size_t j = 1; j < nn_indices.size (); ++j) // nn_indices[0] should be sq_idx
154  {
155  if (processed[nn_indices[j]]) // Has this point been processed before ?
156  continue;
157 
158  //processed[nn_indices[j]] = true;
159  // [-1;1]
160  double dot_p = normals[seed_queue[sq_idx]].normal[0] * normals[nn_indices[j]].normal[0] +
161  normals[seed_queue[sq_idx]].normal[1] * normals[nn_indices[j]].normal[1] +
162  normals[seed_queue[sq_idx]].normal[2] * normals[nn_indices[j]].normal[2];
163  if ( std::acos (std::abs (dot_p)) < eps_angle )
164  {
165  processed[nn_indices[j]] = true;
166  seed_queue.push_back (nn_indices[j]);
167  }
168  }
169 
170  sq_idx++;
171  }
172 
173  // If this queue is satisfactory, add to the clusters
174  if (seed_queue.size () >= min_pts_per_cluster && seed_queue.size () <= max_pts_per_cluster)
175  {
177  r.indices.resize (seed_queue.size ());
178  for (std::size_t j = 0; j < seed_queue.size (); ++j)
179  r.indices[j] = seed_queue[j];
180 
181  // These two lines should not be needed: (can anyone confirm?) -FF
182  std::sort (r.indices.begin (), r.indices.end ());
183  r.indices.erase (std::unique (r.indices.begin (), r.indices.end ()), r.indices.end ());
184 
185  r.header = cloud.header;
186  clusters.push_back (r); // We could avoid a copy by working directly in the vector
187  }
188  }
189  }
190 
191 
192  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
193  /** \brief Decompose a region of space into clusters based on the euclidean distance between points, and the normal
194  * angular deviation between points. Each point added to the cluster is origin to another radius search. Each point
195  * within radius range will be compared to the origin in respect to normal angle and euclidean distance. If both
196  * are under their respective threshold the point will be added to the cluster. Generally speaking the cluster
197  * algorithm will not stop on smooth surfaces but on surfaces with sharp edges.
198  * \param cloud the point cloud message
199  * \param normals the point cloud message containing normal information
200  * \param indices a list of point indices to use from \a cloud
201  * \param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
202  * \note the tree has to be created as a spatial locator on \a cloud
203  * \param tolerance the spatial cluster tolerance as a measure in the L2 Euclidean space
204  * \param clusters the resultant clusters containing point indices (as PointIndices)
205  * \param eps_angle the maximum allowed difference between normals in radians for cluster/region growing
206  * \param min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
207  * \param max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
208  * \ingroup segmentation
209  */
210  template <typename PointT, typename Normal>
212  const PointCloud<PointT> &cloud, const PointCloud<Normal> &normals,
213  const Indices &indices, const typename KdTree<PointT>::Ptr &tree,
214  float tolerance, std::vector<PointIndices> &clusters, double eps_angle,
215  unsigned int min_pts_per_cluster = 1,
216  unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ())
217  {
218  // \note If the tree was created over <cloud, indices>, we guarantee a 1-1 mapping between what the tree returns
219  //and indices[i]
220  if (tree->getInputCloud()->size() != cloud.size()) {
221  PCL_ERROR("[pcl::extractEuclideanClusters] Tree built for a different point "
222  "cloud dataset (%zu) than the input cloud (%zu)!\n",
223  static_cast<std::size_t>(tree->getInputCloud()->size()),
224  static_cast<std::size_t>(cloud.size()));
225  return;
226  }
227  if (tree->getIndices()->size() != indices.size()) {
228  PCL_ERROR("[pcl::extractEuclideanClusters] Tree built for a different set of "
229  "indices (%zu) than the input set (%zu)!\n",
230  static_cast<std::size_t>(tree->getIndices()->size()),
231  indices.size());
232  return;
233  }
234  if (cloud.size() != normals.size()) {
235  PCL_ERROR("[pcl::extractEuclideanClusters] Number of points in the input point "
236  "cloud (%zu) different than normals (%zu)!\n",
237  static_cast<std::size_t>(cloud.size()),
238  static_cast<std::size_t>(normals.size()));
239  return;
240  }
241  // Create a bool vector of processed point indices, and initialize it to false
242  std::vector<bool> processed (cloud.size (), false);
243 
244  Indices nn_indices;
245  std::vector<float> nn_distances;
246  // Process all points in the indices vector
247  for (std::size_t i = 0; i < indices.size (); ++i)
248  {
249  if (processed[indices[i]])
250  continue;
251 
252  Indices seed_queue;
253  int sq_idx = 0;
254  seed_queue.push_back (indices[i]);
255 
256  processed[indices[i]] = true;
257 
258  while (sq_idx < static_cast<int> (seed_queue.size ()))
259  {
260  // Search for sq_idx
261  if (!tree->radiusSearch (cloud[seed_queue[sq_idx]], tolerance, nn_indices, nn_distances))
262  {
263  sq_idx++;
264  continue;
265  }
266 
267  for (std::size_t j = 1; j < nn_indices.size (); ++j) // nn_indices[0] should be sq_idx
268  {
269  if (processed[nn_indices[j]]) // Has this point been processed before ?
270  continue;
271 
272  //processed[nn_indices[j]] = true;
273  // [-1;1]
274  double dot_p = normals[seed_queue[sq_idx]].normal[0] * normals[nn_indices[j]].normal[0] +
275  normals[seed_queue[sq_idx]].normal[1] * normals[nn_indices[j]].normal[1] +
276  normals[seed_queue[sq_idx]].normal[2] * normals[nn_indices[j]].normal[2];
277  if ( std::acos (std::abs (dot_p)) < eps_angle )
278  {
279  processed[nn_indices[j]] = true;
280  seed_queue.push_back (nn_indices[j]);
281  }
282  }
283 
284  sq_idx++;
285  }
286 
287  // If this queue is satisfactory, add to the clusters
288  if (seed_queue.size () >= min_pts_per_cluster && seed_queue.size () <= max_pts_per_cluster)
289  {
291  r.indices.resize (seed_queue.size ());
292  for (std::size_t j = 0; j < seed_queue.size (); ++j)
293  r.indices[j] = seed_queue[j];
294 
295  // These two lines should not be needed: (can anyone confirm?) -FF
296  std::sort (r.indices.begin (), r.indices.end ());
297  r.indices.erase (std::unique (r.indices.begin (), r.indices.end ()), r.indices.end ());
298 
299  r.header = cloud.header;
300  clusters.push_back (r);
301  }
302  }
303  }
304 
305  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
306  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
307  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
308  /** \brief @b EuclideanClusterExtraction represents a segmentation class for cluster extraction in an Euclidean sense.
309  * \author Radu Bogdan Rusu
310  * \ingroup segmentation
311  */
312  template <typename PointT>
313  class EuclideanClusterExtraction: public PCLBase<PointT>
314  {
316 
317  public:
319  using PointCloudPtr = typename PointCloud::Ptr;
321 
323  using KdTreePtr = typename KdTree::Ptr;
324 
327 
328  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
329  /** \brief Empty constructor. */
331  cluster_tolerance_ (0),
333  max_pts_per_cluster_ (std::numeric_limits<int>::max ())
334  {};
335 
336  /** \brief Provide a pointer to the search object.
337  * \param[in] tree a pointer to the spatial search object.
338  */
339  inline void
340  setSearchMethod (const KdTreePtr &tree)
341  {
342  tree_ = tree;
343  }
344 
345  /** \brief Get a pointer to the search method used.
346  * @todo fix this for a generic search tree
347  */
348  inline KdTreePtr
349  getSearchMethod () const
350  {
351  return (tree_);
352  }
353 
354  /** \brief Set the spatial cluster tolerance as a measure in the L2 Euclidean space
355  * \param[in] tolerance the spatial cluster tolerance as a measure in the L2 Euclidean space
356  */
357  inline void
358  setClusterTolerance (double tolerance)
359  {
360  cluster_tolerance_ = tolerance;
361  }
362 
363  /** \brief Get the spatial cluster tolerance as a measure in the L2 Euclidean space. */
364  inline double
366  {
367  return (cluster_tolerance_);
368  }
369 
370  /** \brief Set the minimum number of points that a cluster needs to contain in order to be considered valid.
371  * \param[in] min_cluster_size the minimum cluster size
372  */
373  inline void
374  setMinClusterSize (int min_cluster_size)
375  {
376  min_pts_per_cluster_ = min_cluster_size;
377  }
378 
379  /** \brief Get the minimum number of points that a cluster needs to contain in order to be considered valid. */
380  inline int
382  {
383  return (min_pts_per_cluster_);
384  }
385 
386  /** \brief Set the maximum number of points that a cluster needs to contain in order to be considered valid.
387  * \param[in] max_cluster_size the maximum cluster size
388  */
389  inline void
390  setMaxClusterSize (int max_cluster_size)
391  {
392  max_pts_per_cluster_ = max_cluster_size;
393  }
394 
395  /** \brief Get the maximum number of points that a cluster needs to contain in order to be considered valid. */
396  inline int
398  {
399  return (max_pts_per_cluster_);
400  }
401 
402  /** \brief Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>
403  * \param[out] clusters the resultant point clusters
404  */
405  void
406  extract (std::vector<PointIndices> &clusters);
407 
408  protected:
409  // Members derived from the base class
410  using BasePCLBase::input_;
411  using BasePCLBase::indices_;
414 
415  /** \brief A pointer to the spatial search object. */
417 
418  /** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */
420 
421  /** \brief The minimum number of points that a cluster needs to contain in order to be considered valid (default = 1). */
423 
424  /** \brief The maximum number of points that a cluster needs to contain in order to be considered valid (default = MAXINT). */
426 
427  /** \brief Class getName method. */
428  virtual std::string getClassName () const { return ("EuclideanClusterExtraction"); }
429 
430  };
431 
432  /** \brief Sort clusters method (for std::sort).
433  * \ingroup segmentation
434  */
435  inline bool
437  {
438  return (a.indices.size () < b.indices.size ());
439  }
440 }
441 
442 #ifdef PCL_NO_PRECOMPILE
443 #include <pcl/segmentation/impl/extract_clusters.hpp>
444 #endif
pcl::search::Search
Generic search class.
Definition: search.h:74
pcl
Definition: convolution.h:46
pcl::EuclideanClusterExtraction::setMinClusterSize
void setMinClusterSize(int min_cluster_size)
Set the minimum number of points that a cluster needs to contain in order to be considered valid.
Definition: extract_clusters.h:374
pcl::EuclideanClusterExtraction::setClusterTolerance
void setClusterTolerance(double tolerance)
Set the spatial cluster tolerance as a measure in the L2 Euclidean space.
Definition: extract_clusters.h:358
pcl::EuclideanClusterExtraction::extract
void extract(std::vector< PointIndices > &clusters)
Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>
Definition: extract_clusters.hpp:218
pcl::PCLBase::PointCloudConstPtr
typename PointCloud::ConstPtr PointCloudConstPtr
Definition: pcl_base.h:74
pcl::EuclideanClusterExtraction::getMinClusterSize
int getMinClusterSize() const
Get the minimum number of points that a cluster needs to contain in order to be considered valid.
Definition: extract_clusters.h:381
pcl::KdTree
KdTree represents the base spatial locator class for kd-tree implementations.
Definition: kdtree.h:54
pcl::PCLBase::input_
PointCloudConstPtr input_
The input point cloud dataset.
Definition: pcl_base.h:147
pcl::PCLBase::PointCloudPtr
typename PointCloud::Ptr PointCloudPtr
Definition: pcl_base.h:73
pcl::PointIndices::indices
Indices indices
Definition: PointIndices.h:21
pcl::PointIndices::header
::pcl::PCLHeader header
Definition: PointIndices.h:19
pcl::EuclideanClusterExtraction::setMaxClusterSize
void setMaxClusterSize(int max_cluster_size)
Set the maximum number of points that a cluster needs to contain in order to be considered valid.
Definition: extract_clusters.h:390
pcl::PCLBase
PCL base class.
Definition: pcl_base.h:69
pcl::PCLBase::PointIndicesConstPtr
PointIndices::ConstPtr PointIndicesConstPtr
Definition: pcl_base.h:77
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: distances.h:55
pcl::index_t
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
Definition: types.h:110
pcl::EuclideanClusterExtraction::KdTreePtr
typename KdTree::Ptr KdTreePtr
Definition: extract_clusters.h:323
pcl::EuclideanClusterExtraction::setSearchMethod
void setSearchMethod(const KdTreePtr &tree)
Provide a pointer to the search object.
Definition: extract_clusters.h:340
pcl::EuclideanClusterExtraction::EuclideanClusterExtraction
EuclideanClusterExtraction()
Empty constructor.
Definition: extract_clusters.h:330
pcl::EuclideanClusterExtraction
EuclideanClusterExtraction represents a segmentation class for cluster extraction in an Euclidean sen...
Definition: extract_clusters.h:313
pcl::PointIndices::ConstPtr
shared_ptr< const ::pcl::PointIndices > ConstPtr
Definition: PointIndices.h:14
pcl::KdTree::radiusSearch
virtual int radiusSearch(const PointT &p_q, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const =0
Search for all the nearest neighbors of the query point in a given radius.
pcl::EuclideanClusterExtraction::max_pts_per_cluster_
int max_pts_per_cluster_
The maximum number of points that a cluster needs to contain in order to be considered valid (default...
Definition: extract_clusters.h:425
pcl::EuclideanClusterExtraction::min_pts_per_cluster_
int min_pts_per_cluster_
The minimum number of points that a cluster needs to contain in order to be considered valid (default...
Definition: extract_clusters.h:422
pcl::KdTree::getIndices
IndicesConstPtr getIndices() const
Get a pointer to the vector of indices used.
Definition: kdtree.h:93
pcl::KdTree::getInputCloud
PointCloudConstPtr getInputCloud() const
Get a pointer to the input point cloud dataset.
Definition: kdtree.h:100
pcl::search::Search::Ptr
shared_ptr< pcl::search::Search< PointT > > Ptr
Definition: search.h:81
pcl::EuclideanClusterExtraction::getSearchMethod
KdTreePtr getSearchMethod() const
Get a pointer to the search method used.
Definition: extract_clusters.h:349
pcl::PointIndices
Definition: PointIndices.h:11
pcl::PointCloud::header
pcl::PCLHeader header
The point cloud header.
Definition: point_cloud.h:385
pcl::Indices
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition: types.h:131
pcl::PointIndices::Ptr
shared_ptr< ::pcl::PointIndices > Ptr
Definition: PointIndices.h:13
pcl::PointCloud::size
std::size_t size() const
Definition: point_cloud.h:436
pcl::PointCloud::Ptr
shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:406
pcl::PCLBase::deinitCompute
bool deinitCompute()
This method should get called after finishing the actual computation.
Definition: pcl_base.hpp:171
pcl::PCLBase::indices_
IndicesPtr indices_
A pointer to the vector of point indices to use.
Definition: pcl_base.h:150
pcl::EuclideanClusterExtraction::tree_
KdTreePtr tree_
A pointer to the spatial search object.
Definition: extract_clusters.h:416
pcl::PointCloud::ConstPtr
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:407
pcl::EuclideanClusterExtraction::getClusterTolerance
double getClusterTolerance() const
Get the spatial cluster tolerance as a measure in the L2 Euclidean space.
Definition: extract_clusters.h:365
pcl::PCLBase::PointIndicesPtr
PointIndices::Ptr PointIndicesPtr
Definition: pcl_base.h:76
pcl::comparePointClusters
bool comparePointClusters(const pcl::PointIndices &a, const pcl::PointIndices &b)
Sort clusters method (for std::sort).
Definition: extract_clusters.h:436
pcl::EuclideanClusterExtraction::cluster_tolerance_
double cluster_tolerance_
The spatial cluster tolerance as a measure in the L2 Euclidean space.
Definition: extract_clusters.h:419
pcl::EuclideanClusterExtraction::getMaxClusterSize
int getMaxClusterSize() const
Get the maximum number of points that a cluster needs to contain in order to be considered valid.
Definition: extract_clusters.h:397
pcl::PCLBase::initCompute
bool initCompute()
This method should get called before starting the actual computation.
Definition: pcl_base.hpp:138
pcl::PointCloud::push_back
void push_back(const PointT &pt)
Insert a new point in the cloud, at the end of the container.
Definition: point_cloud.h:543
pcl::extractEuclideanClusters
void extractEuclideanClusters(const PointCloud< PointT > &cloud, const typename search::Search< PointT >::Ptr &tree, float tolerance, std::vector< PointIndices > &clusters, unsigned int min_pts_per_cluster=1, unsigned int max_pts_per_cluster=(std::numeric_limits< int >::max)())
Decompose a region of space into clusters based on the Euclidean distance between points.
Definition: extract_clusters.hpp:46
pcl::EuclideanClusterExtraction::getClassName
virtual std::string getClassName() const
Class getName method.
Definition: extract_clusters.h:428