Loading...
Searching...
No Matches
pcl::EuclideanClusterExtraction< PointT > Class Template Reference
Module segmentation

EuclideanClusterExtraction represents a segmentation class for cluster extraction in an Euclidean sense. More...

`#include <pcl/segmentation/extract_clusters.h>`

Inheritance diagram for pcl::EuclideanClusterExtraction< PointT >:

## Public Types

using | PointCloud = pcl::PointCloud<PointT>
using | PointCloudPtr = typename PointCloud::Ptr
using | PointCloudConstPtr = typename PointCloud::ConstPtr
using | KdTree = pcl::search::Search<PointT>
using | KdTreePtr = typename KdTree::Ptr
using | PointIndicesPtr = PointIndices::Ptr
using | PointIndicesConstPtr = PointIndices::ConstPtr
Public Types inherited from pcl::PCLBase< PointT >
using | PointCloud = pcl::PointCloud<PointT>
using | PointCloudPtr = typename PointCloud::Ptr
using | PointCloudConstPtr = typename PointCloud::ConstPtr
using | PointIndicesPtr = PointIndices::Ptr
using | PointIndicesConstPtr = PointIndices::ConstPtr

## Public Member Functions

| EuclideanClusterExtraction ()=default
| Empty constructor.
void | setSearchMethod (const KdTreePtr &tree)
| Provide a pointer to the search object.
KdTreePtr | getSearchMethod () const
| Get a pointer to the search method used.
void | setClusterTolerance (double tolerance)
| Set the spatial cluster tolerance as a measure in the L2 Euclidean space.
double | getClusterTolerance () const
| Get the spatial cluster tolerance as a measure in the L2 Euclidean space.
void | setMinClusterSize (pcl::uindex_t min_cluster_size)
| Set the minimum number of points that a cluster needs to contain in order to be considered valid.
pcl::uindex_t | getMinClusterSize () const
| Get the minimum number of points that a cluster needs to contain in order to be considered valid.
void | setMaxClusterSize (pcl::uindex_t max_cluster_size)
| Set the maximum number of points that a cluster needs to contain in order to be considered valid.
pcl::uindex_t | getMaxClusterSize () const
| Get the maximum number of points that a cluster needs to contain in order to be considered valid.
void | extract (std::vector< PointIndices > &clusters)
| Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>.
Public Member Functions inherited from pcl::PCLBase< PointT >
| PCLBase ()
| Empty constructor.
| PCLBase (const PCLBase &base)
| Copy constructor.
virtual | ~PCLBase ()=default
| Destructor.
virtual void | setInputCloud (const PointCloudConstPtr &cloud)
| Provide a pointer to the input dataset.
PointCloudConstPtr const | getInputCloud () const
| Get a pointer to the input point cloud dataset.
virtual void | setIndices (const IndicesPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
virtual void | setIndices (const IndicesConstPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
virtual void | setIndices (const PointIndicesConstPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
virtual void | setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols)
| Set the indices for the points laying within an interest region of the point cloud.
IndicesPtr | getIndices ()
| Get a pointer to the vector of indices used.
IndicesConstPtr const | getIndices () const
| Get a pointer to the vector of indices used.
const PointT & | operator[] (std::size_t pos) const
| Override PointCloud operator[] to shorten code.

## Protected Member Functions

virtual std::string | getClassName () const
| Class getName method.
bool | initCompute ()
| This method should get called before starting the actual computation.
bool | deinitCompute ()
| This method should get called after finishing the actual computation.
Protected Member Functions inherited from pcl::PCLBase< PointT >
bool | initCompute ()
| This method should get called before starting the actual computation.
bool | deinitCompute ()
| This method should get called after finishing the actual computation.

## Protected Attributes

KdTreePtr | tree_ {nullptr}
| A pointer to the spatial search object.
double | cluster_tolerance_ {0.0}
| The spatial cluster tolerance as a measure in the L2 Euclidean space.
pcl::uindex_t | min_pts_per_cluster_ {1}
| The minimum number of points that a cluster needs to contain in order to be considered valid (default = 1).
pcl::uindex_t | max_pts_per_cluster_ {std::numeric_limits<pcl::uindex_t>::max()}
| The maximum number of points that a cluster needs to contain in order to be considered valid (default = MAXINT).
PointCloudConstPtr | input_
| The input point cloud dataset.
IndicesPtr | indices_
| A pointer to the vector of point indices to use.
Protected Attributes inherited from pcl::PCLBase< PointT >
PointCloudConstPtr | input_
| The input point cloud dataset.
IndicesPtr | indices_
| A pointer to the vector of point indices to use.
bool | use_indices_
| Set to true if point indices are used.
bool | fake_indices_
| If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud.

## Detailed Description

template<typename PointT>
class pcl::EuclideanClusterExtraction< PointT >

EuclideanClusterExtraction represents a segmentation class for cluster extraction in an Euclidean sense.

Author
  Radu Bogdan Rusu

Definition at line 327 of file extract_clusters.h.

## Member Typedef Documentation

## KdTree

template<typename PointT>

using pcl::EuclideanClusterExtraction< PointT >::KdTree = pcl::search::Search<PointT>

Definition at line 336 of file extract_clusters.h.

## KdTreePtr

template<typename PointT>

using pcl::EuclideanClusterExtraction< PointT >::KdTreePtr = typename KdTree::Ptr

Definition at line 337 of file extract_clusters.h.

## PointCloud

template<typename PointT>

using pcl::EuclideanClusterExtraction< PointT >::PointCloud = pcl::PointCloud<PointT>

Definition at line 332 of file extract_clusters.h.

## PointCloudConstPtr

template<typename PointT>

using pcl::EuclideanClusterExtraction< PointT >::PointCloudConstPtr = typename PointCloud::ConstPtr

Definition at line 334 of file extract_clusters.h.

## PointCloudPtr

template<typename PointT>

using pcl::EuclideanClusterExtraction< PointT >::PointCloudPtr = typename PointCloud::Ptr

Definition at line 333 of file extract_clusters.h.

## PointIndicesConstPtr

template<typename PointT>

using pcl::EuclideanClusterExtraction< PointT >::PointIndicesConstPtr = PointIndices::ConstPtr

Definition at line 340 of file extract_clusters.h.

## PointIndicesPtr

template<typename PointT>

using pcl::EuclideanClusterExtraction< PointT >::PointIndicesPtr = PointIndices::Ptr

Definition at line 339 of file extract_clusters.h.

## Constructor & Destructor Documentation

## EuclideanClusterExtraction()

template<typename PointT>

pcl::EuclideanClusterExtraction< PointT >::EuclideanClusterExtraction | ( |  | ) |

default

Empty constructor.

## Member Function Documentation

## deinitCompute()

template<typename PointT>

bool pcl::PCLBase< PointT >::deinitCompute | ( |  | ) |

protected

This method should get called after finishing the actual computation.

Definition at line 173 of file pcl_base.hpp.

Referenced by extract().

## extract()

template<typename PointT>

void pcl::EuclideanClusterExtraction< PointT >::extract | ( | std::vector< PointIndices > & | clusters | ) |

Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>.

Parameters

  [out] | clusters | the resultant point clusters

Definition at line 224 of file extract_clusters.hpp.

References cluster_tolerance_, pcl::comparePointClusters(), deinitCompute(), pcl::extractEuclideanClusters(), indices_, initCompute(), input_, max_pts_per_cluster_, min_pts_per_cluster_, and tree_.

Referenced by pcl::people::GroundBasedPeopleDetectionApp< PointT >::compute().

## getClassName()

template<typename PointT>

virtual std::string pcl::EuclideanClusterExtraction< PointT >::getClassName | ( |  | ) | const

inline protected virtual

Class getName method.

Definition at line 438 of file extract_clusters.h.

## getClusterTolerance()

template<typename PointT>

double pcl::EuclideanClusterExtraction< PointT >::getClusterTolerance | ( |  | ) | const

inline

Get the spatial cluster tolerance as a measure in the L2 Euclidean space.

Definition at line 375 of file extract_clusters.h.

References cluster_tolerance_.

## getMaxClusterSize()

template<typename PointT>

pcl::uindex_t pcl::EuclideanClusterExtraction< PointT >::getMaxClusterSize | ( |  | ) | const

inline

Get the maximum number of points that a cluster needs to contain in order to be considered valid.

Definition at line 407 of file extract_clusters.h.

References max_pts_per_cluster_.

## getMinClusterSize()

template<typename PointT>

pcl::uindex_t pcl::EuclideanClusterExtraction< PointT >::getMinClusterSize | ( |  | ) | const

inline

Get the minimum number of points that a cluster needs to contain in order to be considered valid.

Definition at line 391 of file extract_clusters.h.

References min_pts_per_cluster_.

## getSearchMethod()

template<typename PointT>

KdTreePtr pcl::EuclideanClusterExtraction< PointT >::getSearchMethod | ( |  | ) | const

inline

Get a pointer to the search method used.

Todo
  fix this for a generic search tree

Definition at line 359 of file extract_clusters.h.

References tree_.

## initCompute()

template<typename PointT>

bool pcl::PCLBase< PointT >::initCompute | ( |  | ) |

protected

This method should get called before starting the actual computation.

Internally, initCompute() does the following:

- checks if an input dataset is given, and returns false otherwise
- checks whether a set of input indices has been given. Returns true if yes.
- if no input indices have been given, a fake set is created, which will be used until:
  - either a new set is given via setIndices(), or
  - a new cloud is given that has a different set of points. This will trigger an update on the set of fake indices

Definition at line 168 of file pcl_base.hpp.

Referenced by extract().

## setClusterTolerance()

template<typename PointT>

void pcl::EuclideanClusterExtraction< PointT >::setClusterTolerance | ( | double | tolerance | ) |

inline

Set the spatial cluster tolerance as a measure in the L2 Euclidean space.

Parameters

  [in] | tolerance | the spatial cluster tolerance as a measure in the L2 Euclidean space

Definition at line 368 of file extract_clusters.h.

References cluster_tolerance_.

Referenced by pcl::people::GroundBasedPeopleDetectionApp< PointT >::compute().

## setMaxClusterSize()

template<typename PointT>

void pcl::EuclideanClusterExtraction< PointT >::setMaxClusterSize | ( | pcl::uindex_t | max_cluster_size | ) |

inline

Set the maximum number of points that a cluster needs to contain in order to be considered valid.

Parameters

  [in] | max_cluster_size | the maximum cluster size

Definition at line 400 of file extract_clusters.h.

References max_pts_per_cluster_.

Referenced by pcl::people::GroundBasedPeopleDetectionApp< PointT >::compute().

## setMinClusterSize()

template<typename PointT>

void pcl::EuclideanClusterExtraction< PointT >::setMinClusterSize | ( | pcl::uindex_t | min_cluster_size | ) |

inline

Set the minimum number of points that a cluster needs to contain in order to be considered valid.

Parameters

  [in] | min_cluster_size | the minimum cluster size

Definition at line 384 of file extract_clusters.h.

References min_pts_per_cluster_.

Referenced by pcl::people::GroundBasedPeopleDetectionApp< PointT >::compute().

## setSearchMethod()

template<typename PointT>

void pcl::EuclideanClusterExtraction< PointT >::setSearchMethod | ( | const KdTreePtr & | tree | ) |

inline

Provide a pointer to the search object.

Parameters

  [in] | tree | a pointer to the spatial search object.

Definition at line 350 of file extract_clusters.h.

References tree_.

Referenced by pcl::people::GroundBasedPeopleDetectionApp< PointT >::compute().

## Member Data Documentation

## cluster_tolerance_

template<typename PointT>

double pcl::EuclideanClusterExtraction< PointT >::cluster_tolerance_ {0.0}

protected

The spatial cluster tolerance as a measure in the L2 Euclidean space.

Definition at line 429 of file extract_clusters.h.

Referenced by extract(), getClusterTolerance(), and setClusterTolerance().

## indices_

template<typename PointT>

IndicesPtr pcl::PCLBase< PointT >::indices_

protected

A pointer to the vector of point indices to use.

Definition at line 150 of file pcl_base.h.

Referenced by extract().

## input_

template<typename PointT>

PointCloudConstPtr pcl::PCLBase< PointT >::input_

protected

The input point cloud dataset.

Definition at line 147 of file pcl_base.h.

Referenced by extract().

## max_pts_per_cluster_

template<typename PointT>

pcl::uindex_t pcl::EuclideanClusterExtraction< PointT >::max_pts_per_cluster_ {std::numeric_limits<pcl::uindex_t>::max()}

protected

The maximum number of points that a cluster needs to contain in order to be considered valid (default = MAXINT).

Definition at line 435 of file extract_clusters.h.

Referenced by extract(), getMaxClusterSize(), and setMaxClusterSize().

## min_pts_per_cluster_

template<typename PointT>

pcl::uindex_t pcl::EuclideanClusterExtraction< PointT >::min_pts_per_cluster_ {1}

protected

The minimum number of points that a cluster needs to contain in order to be considered valid (default = 1).

Definition at line 432 of file extract_clusters.h.

Referenced by extract(), getMinClusterSize(), and setMinClusterSize().

## tree_

template<typename PointT>

KdTreePtr pcl::EuclideanClusterExtraction< PointT >::tree_ {nullptr}

protected

A pointer to the spatial search object.

Definition at line 426 of file extract_clusters.h.

Referenced by extract(), getSearchMethod(), and setSearchMethod().

The documentation for this class was generated from the following files:

- pcl/segmentation/extract_clusters.h
- pcl/segmentation/impl/extract_clusters.hpp