Point Cloud Library (PCL) 1.12.0
Loading...
Searching...
No Matches
List of all members | 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.
 
 ~OrganizedConnectedComponentSegmentation ()
 Destructor for OrganizedConnectedComponentSegmentation.
 
void setComparator (const ComparatorConstPtr &compare)
 Provide a pointer to the comparator to be used for segmentation.
 
ComparatorConstPtr getComparator () const
 Get the comparator.
 
void segment (pcl::PointCloud< PointLT > &labels, std::vector< pcl::PointIndices > &label_indices) const
 Perform the connected component segmentation.
 
- 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 PointToperator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code.
 

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.
 

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.
 
bool deinitCompute ()
 This method should get called after finishing the actual computation.
 

Protected Attributes

ComparatorConstPtr compare_
 
- 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, 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 58 of file organized_connected_component_segmentation.h.

Member Typedef Documentation

◆ Comparator

Definition at line 74 of file organized_connected_component_segmentation.h.

◆ ComparatorConstPtr

Definition at line 76 of file organized_connected_component_segmentation.h.

◆ ComparatorPtr

Definition at line 75 of file organized_connected_component_segmentation.h.

◆ PointCloud

Definition at line 66 of file organized_connected_component_segmentation.h.

◆ PointCloudConstPtr

Definition at line 68 of file organized_connected_component_segmentation.h.

◆ PointCloudL

Definition at line 70 of file organized_connected_component_segmentation.h.

◆ PointCloudLConstPtr

Definition at line 72 of file organized_connected_component_segmentation.h.

◆ PointCloudLPtr

Definition at line 71 of file organized_connected_component_segmentation.h.

◆ PointCloudPtr

Definition at line 67 of file organized_connected_component_segmentation.h.

Constructor & Destructor Documentation

◆ OrganizedConnectedComponentSegmentation()

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 81 of file organized_connected_component_segmentation.h.

◆ ~OrganizedConnectedComponentSegmentation()

Member Function Documentation

◆ findLabeledRegionBoundary()

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::ConstCloudIterator< PointT >::ConstCloudIterator().

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

◆ findRoot()

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

◆ getComparator()

◆ segment()

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::ConstCloudIterator< PointT >::size().

◆ setComparator()

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

Parameters
[in]comparethe comparator

Definition at line 96 of file organized_connected_component_segmentation.h.

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

Member Data Documentation

◆ compare_


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