Point Cloud Library (PCL)  1.8.1-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 >:

Public Types

typedef pcl::PointCloud< PointTPointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
typedef pcl::PointCloud< PointLT > PointCloudL
 
typedef PointCloudL::Ptr PointCloudLPtr
 
typedef PointCloudL::ConstPtr PointCloudLConstPtr
 
typedef pcl::Comparator< PointTComparator
 
typedef Comparator::Ptr ComparatorPtr
 
typedef Comparator::ConstPtr ComparatorConstPtr
 
- Public Types inherited from pcl::PCLBase< PointT >
typedef pcl::PointCloud< PointTPointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
typedef boost::shared_ptr
< PointIndices
PointIndicesPtr
 
typedef boost::shared_ptr
< PointIndices const > 
PointIndicesConstPtr
 

Public Member Functions

 OrganizedConnectedComponentSegmentation (const ComparatorConstPtr &compare)
 Constructor for OrganizedConnectedComponentSegmentation. More...
 
virtual ~OrganizedConnectedComponentSegmentation ()
 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 ()
 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 (size_t row_start, size_t col_start, size_t nb_rows, size_t nb_cols)
 Set the indices for the points laying within an interest region of the point cloud. More...
 
IndicesPtr const 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[] (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

template<typename PointT, typename PointLT>
typedef pcl::Comparator<PointT> pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::Comparator

Definition at line 75 of file organized_connected_component_segmentation.h.

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

Definition at line 77 of file organized_connected_component_segmentation.h.

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

Definition at line 76 of file organized_connected_component_segmentation.h.

template<typename PointT, typename PointLT>
typedef pcl::PointCloud<PointT> pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloud

Definition at line 67 of file organized_connected_component_segmentation.h.

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

Definition at line 69 of file organized_connected_component_segmentation.h.

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

Definition at line 71 of file organized_connected_component_segmentation.h.

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

Definition at line 73 of file organized_connected_component_segmentation.h.

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

Definition at line 72 of file organized_connected_component_segmentation.h.

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

Definition at line 68 of file organized_connected_component_segmentation.h.

Constructor & Destructor Documentation

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.

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

Member Function Documentation

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 shoudl 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().

template<typename PointT, typename PointLT>
unsigned pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::findRoot ( const std::vector< unsigned > &  runs,
unsigned  index 
) const
inlineprotected
template<typename PointT, typename PointLT>
ComparatorConstPtr pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::getComparator ( ) const
inline
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< T >::height, pcl::PointCloud< T >::points, pcl::PointCloud< T >::push_back(), and pcl::PointCloud< T >::width.

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

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

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

Member Data Documentation

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

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