Point Cloud Library (PCL)  1.14.0-dev
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT > Class Template Reference

OrganizedConnectedComponentSegmentation allows connected components to be found within organized point cloud data, given a comparison function. More...

#include <pcl/segmentation/organized_connected_component_segmentation.h>

+ Inheritance diagram for pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >:
+ Collaboration diagram for pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >:

Public Types

using PointCloud = pcl::PointCloud< PointT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
using PointCloudL = pcl::PointCloud< PointLT >
 
using PointCloudLPtr = typename PointCloudL::Ptr
 
using PointCloudLConstPtr = typename PointCloudL::ConstPtr
 
using Comparator = pcl::Comparator< PointT >
 
using ComparatorPtr = typename Comparator::Ptr
 
using ComparatorConstPtr = typename Comparator::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

 OrganizedConnectedComponentSegmentation (const ComparatorConstPtr &compare)
 Constructor for OrganizedConnectedComponentSegmentation. More...
 
 ~OrganizedConnectedComponentSegmentation () override=default
 Destructor for OrganizedConnectedComponentSegmentation. More...
 
void setComparator (const ComparatorConstPtr &compare)
 Provide a pointer to the comparator to be used for segmentation. More...
 
ComparatorConstPtr getComparator () const
 Get the comparator. More...
 
void segment (pcl::PointCloud< PointLT > &labels, std::vector< pcl::PointIndices > &label_indices) const
 Perform the connected component segmentation. More...
 
- Public Member Functions inherited from pcl::PCLBase< PointT >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()=default
 Destructor. More...
 
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset. More...
 
PointCloudConstPtr const getInputCloud () const
 Get a pointer to the input point cloud dataset. More...
 
virtual void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
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. More...
 
IndicesPtr getIndices ()
 Get a pointer to the vector of indices used. More...
 
IndicesConstPtr const getIndices () const
 Get a pointer to the vector of indices used. More...
 
const PointToperator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Static Public Member Functions

static void findLabeledRegionBoundary (int start_idx, PointCloudLPtr labels, pcl::PointIndices &boundary_indices)
 Find the boundary points / contour of a connected component. More...
 

Protected Member Functions

unsigned findRoot (const std::vector< unsigned > &runs, unsigned index) const
 
- Protected Member Functions inherited from pcl::PCLBase< PointT >
bool initCompute ()
 This method should get called before starting the actual computation. More...
 
bool deinitCompute ()
 This method should get called after finishing the actual computation. More...
 

Protected Attributes

ComparatorConstPtr compare_
 
- Protected Attributes inherited from pcl::PCLBase< PointT >
PointCloudConstPtr input_
 The input point cloud dataset. More...
 
IndicesPtr indices_
 A pointer to the vector of point indices to use. More...
 
bool use_indices_
 Set to true if point indices are used. More...
 
bool fake_indices_
 If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More...
 

Detailed Description

template<typename PointT, typename PointLT>
class pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >

OrganizedConnectedComponentSegmentation allows connected components to be found within organized point cloud data, given a comparison function.

Given an input cloud and a comparator, it will output a PointCloud of labels, giving each connected component a unique id, along with a vector of PointIndices corresponding to each component. See OrganizedMultiPlaneSegmentation for an example application.

Author
Alex Trevor, Suat Gedikli

Definition at line 59 of file organized_connected_component_segmentation.h.

Member Typedef Documentation

◆ Comparator

template<typename PointT , typename PointLT >
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::Comparator = pcl::Comparator<PointT>

Definition at line 75 of file organized_connected_component_segmentation.h.

◆ ComparatorConstPtr

template<typename PointT , typename PointLT >
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::ComparatorConstPtr = typename Comparator::ConstPtr

Definition at line 77 of file organized_connected_component_segmentation.h.

◆ ComparatorPtr

template<typename PointT , typename PointLT >
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::ComparatorPtr = typename Comparator::Ptr

Definition at line 76 of file organized_connected_component_segmentation.h.

◆ PointCloud

template<typename PointT , typename PointLT >
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloud = pcl::PointCloud<PointT>

Definition at line 67 of file organized_connected_component_segmentation.h.

◆ PointCloudConstPtr

template<typename PointT , typename PointLT >
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudConstPtr = typename PointCloud::ConstPtr

Definition at line 69 of file organized_connected_component_segmentation.h.

◆ PointCloudL

template<typename PointT , typename PointLT >
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudL = pcl::PointCloud<PointLT>

Definition at line 71 of file organized_connected_component_segmentation.h.

◆ PointCloudLConstPtr

template<typename PointT , typename PointLT >
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudLConstPtr = typename PointCloudL::ConstPtr

Definition at line 73 of file organized_connected_component_segmentation.h.

◆ PointCloudLPtr

template<typename PointT , typename PointLT >
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudLPtr = typename PointCloudL::Ptr

Definition at line 72 of file organized_connected_component_segmentation.h.

◆ PointCloudPtr

template<typename PointT , typename PointLT >
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudPtr = typename PointCloud::Ptr

Definition at line 68 of file organized_connected_component_segmentation.h.

Constructor & Destructor Documentation

◆ OrganizedConnectedComponentSegmentation()

template<typename PointT , typename PointLT >
pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::OrganizedConnectedComponentSegmentation ( const ComparatorConstPtr compare)
inline

Constructor for OrganizedConnectedComponentSegmentation.

Parameters
[in]compareA pointer to the comparator to be used for segmentation. Must be an instance of pcl::Comparator.

Definition at line 82 of file organized_connected_component_segmentation.h.

◆ ~OrganizedConnectedComponentSegmentation()

template<typename PointT , typename PointLT >
pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::~OrganizedConnectedComponentSegmentation ( )
overridedefault

Member Function Documentation

◆ findLabeledRegionBoundary()

template<typename PointT , typename PointLT >
void pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::findLabeledRegionBoundary ( int  start_idx,
PointCloudLPtr  labels,
pcl::PointIndices boundary_indices 
)
static

Find the boundary points / contour of a connected component.

Directions: 1 2 3 0 x 4 7 6 5 e.g.

Parameters
[in]start_idxthe first (lowest) index of the connected component for which a boundary should be returned
[in]labelsthe Label cloud produced by segmentation
[out]boundary_indicesthe indices of the boundary points for the label corresponding to start_idx

direction y means we came from pixel with label y to the center pixel x

Definition at line 53 of file organized_connected_component_segmentation.hpp.

References pcl::PointIndices::indices.

Referenced by pcl::OrganizedMultiPlaneSegmentation< PointT, PointNT, PointLT >::segment(), and pcl::OrganizedMultiPlaneSegmentation< PointT, PointNT, PointLT >::segmentAndRefine().

◆ findRoot()

template<typename PointT , typename PointLT >
unsigned pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::findRoot ( const std::vector< unsigned > &  runs,
unsigned  index 
) const
inlineprotected

◆ getComparator()

template<typename PointT , typename PointLT >
ComparatorConstPtr pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::getComparator ( ) const
inline

◆ segment()

template<typename PointT , typename PointLT >
void pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::segment ( pcl::PointCloud< PointLT > &  labels,
std::vector< pcl::PointIndices > &  label_indices 
) const

Perform the connected component segmentation.

Parameters
[out]labelsa PointCloud of labels: each connected component will have a unique id.
[out]label_indicesa vector of PointIndices corresponding to each label / component id.

Definition at line 118 of file organized_connected_component_segmentation.hpp.

References pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::push_back(), pcl::PointCloud< PointT >::resize(), and pcl::PointCloud< PointT >::width.

Referenced by pcl::OrganizedMultiPlaneSegmentation< PointT, PointNT, PointLT >::segment().

◆ setComparator()

template<typename PointT , typename PointLT >
void pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::setComparator ( const ComparatorConstPtr compare)
inline

Provide a pointer to the comparator to be used for segmentation.

Parameters
[in]comparethe comparator

Definition at line 95 of file organized_connected_component_segmentation.h.

References pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::compare_.

Member Data Documentation

◆ compare_

template<typename PointT , typename PointLT >
ComparatorConstPtr pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::compare_
protected

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