pcl::SupervoxelClustering< PointT > Class Template Reference

Implements a supervoxel algorithm based on voxel structure, normals, and rgb values. More...

#include <pcl/segmentation/supervoxel_clustering.h>

Inheritance diagram for pcl::SupervoxelClustering< PointT >:
Inheritance graph
[legend]
Collaboration diagram for pcl::SupervoxelClustering< PointT >:
Collaboration graph
[legend]

List of all members.

Classes

class  SupervoxelHelper
 Internal storage class for supervoxels.
class  VoxelData
 VoxelData is a structure used for storing data within a pcl::octree::OctreePointCloudAdjacencyContainer. More...

Public Types

typedef
pcl::octree::OctreePointCloudAdjacencyContainer
< PointT, VoxelData
LeafContainerT
typedef std::vector
< LeafContainerT * > 
LeafVectorT
typedef pcl::PointCloud< PointTPointCloudT
typedef pcl::PointCloud< NormalNormalCloudT
typedef
pcl::octree::OctreePointCloudAdjacency
< PointT, LeafContainerT
OctreeAdjacencyT
typedef
pcl::octree::OctreePointCloudSearch
< PointT
OctreeSearchT
typedef pcl::search::KdTree
< PointT
KdTreeT
typedef boost::shared_ptr
< std::vector< int > > 
IndicesPtr
typedef boost::adjacency_list
< boost::setS, boost::setS,
boost::undirectedS, uint32_t,
float > 
VoxelAdjacencyList
typedef
VoxelAdjacencyList::vertex_descriptor 
VoxelID
typedef
VoxelAdjacencyList::edge_descriptor 
EdgeID

Public Member Functions

 SupervoxelClustering (float voxel_resolution, float seed_resolution, bool use_single_camera_transform=true)
 Constructor that sets default values for member variables.
virtual ~SupervoxelClustering ()
 This destructor destroys the cloud, normals and search method used for finding neighbors.
void setVoxelResolution (float resolution)
 Set the resolution of the octree voxels.
float getVoxelResolution () const
 Get the resolution of the octree voxels.
void setSeedResolution (float seed_resolution)
 Set the resolution of the octree seed voxels.
float getSeedResolution () const
 Get the resolution of the octree seed voxels.
void setColorImportance (float val)
 Set the importance of color for supervoxels.
void setSpatialImportance (float val)
 Set the importance of spatial distance for supervoxels.
void setNormalImportance (float val)
 Set the importance of scalar normal product for supervoxels.
virtual void extract (std::map< uint32_t, typename Supervoxel< PointT >::Ptr > &supervoxel_clusters)
 This method launches the segmentation algorithm and returns the supervoxels that were obtained during the segmentation.
virtual void setInputCloud (typename pcl::PointCloud< PointT >::ConstPtr cloud)
 This method sets the cloud to be supervoxelized.
virtual void setNormalCloud (typename NormalCloudT::ConstPtr normal_cloud)
 This method sets the normals to be used for supervoxels (should be same size as input cloud).
virtual void refineSupervoxels (int num_itr, std::map< uint32_t, typename Supervoxel< PointT >::Ptr > &supervoxel_clusters)
 This method refines the calculated supervoxels - may only be called after extract.
pcl::PointCloud< PointXYZRGBA >
::Ptr 
getColoredCloud () const
 Returns an RGB colorized cloud showing superpixels Otherwise it returns an empty pointer.
pcl::PointCloud< PointT >::Ptr getVoxelCentroidCloud () const
 Returns a deep copy of the voxel centroid cloud.
pcl::PointCloud< PointXYZL >::Ptr getLabeledCloud () const
 Returns labeled cloud Points that belong to the same supervoxel have the same label.
pcl::PointCloud
< pcl::PointXYZRGBA >::Ptr 
getColoredVoxelCloud () const
 Returns an RGB colorized voxelized cloud showing superpixels Otherwise it returns an empty pointer.
pcl::PointCloud
< pcl::PointXYZL >::Ptr 
getLabeledVoxelCloud () const
 Returns labeled voxelized cloud Points that belong to the same supervoxel have the same label.
void getSupervoxelAdjacencyList (VoxelAdjacencyList &adjacency_list_arg) const
 Gets the adjacency list (Boost Graph library) which gives connections between supervoxels.
void getSupervoxelAdjacency (std::multimap< uint32_t, uint32_t > &label_adjacency) const
 Get a multimap which gives supervoxel adjacency.
int getMaxLabel () const
 Returns the current maximum (highest) label.

Static Public Member Functions

static pcl::PointCloud
< pcl::PointNormal >::Ptr 
makeSupervoxelNormalCloud (std::map< uint32_t, typename Supervoxel< PointT >::Ptr > &supervoxel_clusters)
 Static helper function which returns a pointcloud of normals for the input supervoxels.

Friends

class SupervoxelHelper

Detailed Description

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

Implements a supervoxel algorithm based on voxel structure, normals, and rgb values.

Note:
Supervoxels are oversegmented volumetric patches (usually surfaces)
Usually, color isn't needed (and can be detrimental)- spatial structure is mainly used
  • J. Papon, A. Abramov, M. Schoeler, F. Woergoetter Voxel Cloud Connectivity Segmentation - Supervoxels from PointClouds In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2013
Author:
Jeremie Papon (jpapon@gmail.com)

Definition at line 122 of file supervoxel_clustering.h.


Member Typedef Documentation

template<typename PointT >
typedef VoxelAdjacencyList::edge_descriptor pcl::SupervoxelClustering< PointT >::EdgeID

Definition at line 182 of file supervoxel_clustering.h.

template<typename PointT >
typedef boost::shared_ptr<std::vector<int> > pcl::SupervoxelClustering< PointT >::IndicesPtr

Definition at line 174 of file supervoxel_clustering.h.

template<typename PointT >
typedef pcl::search::KdTree<PointT> pcl::SupervoxelClustering< PointT >::KdTreeT

Definition at line 173 of file supervoxel_clustering.h.

Definition at line 166 of file supervoxel_clustering.h.

template<typename PointT >
typedef std::vector<LeafContainerT*> pcl::SupervoxelClustering< PointT >::LeafVectorT

Definition at line 167 of file supervoxel_clustering.h.

template<typename PointT >
typedef pcl::PointCloud<Normal> pcl::SupervoxelClustering< PointT >::NormalCloudT

Definition at line 170 of file supervoxel_clustering.h.

Definition at line 171 of file supervoxel_clustering.h.

Definition at line 172 of file supervoxel_clustering.h.

template<typename PointT >
typedef pcl::PointCloud<PointT> pcl::SupervoxelClustering< PointT >::PointCloudT

Definition at line 169 of file supervoxel_clustering.h.

template<typename PointT >
typedef boost::adjacency_list<boost::setS, boost::setS, boost::undirectedS, uint32_t, float> pcl::SupervoxelClustering< PointT >::VoxelAdjacencyList

Definition at line 180 of file supervoxel_clustering.h.

template<typename PointT >
typedef VoxelAdjacencyList::vertex_descriptor pcl::SupervoxelClustering< PointT >::VoxelID

Definition at line 181 of file supervoxel_clustering.h.


Constructor & Destructor Documentation

template<typename PointT >
pcl::SupervoxelClustering< PointT >::SupervoxelClustering ( float  voxel_resolution,
float  seed_resolution,
bool  use_single_camera_transform = true 
) [inline]

Constructor that sets default values for member variables.

Parameters:
[in] voxel_resolution The resolution (in meters) of voxels used
[in] seed_resolution The average size (in meters) of resulting supervoxels
[in] use_single_camera_transform Set to true if point density in cloud falls off with distance from origin (such as with a cloud coming from one stationary camera), set false if input cloud is from multiple captures from multiple locations.

Definition at line 47 of file supervoxel_clustering.hpp.

template<typename PointT >
pcl::SupervoxelClustering< PointT >::~SupervoxelClustering (  )  [inline, virtual]

This destructor destroys the cloud, normals and search method used for finding neighbors.

In other words it frees memory.

Definition at line 64 of file supervoxel_clustering.hpp.


Member Function Documentation

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::extract ( std::map< uint32_t, typename Supervoxel< PointT >::Ptr > &  supervoxel_clusters  )  [inline, virtual]

This method launches the segmentation algorithm and returns the supervoxels that were obtained during the segmentation.

Parameters:
[out] supervoxel_clusters A map of labels to pointers to supervoxel structures

Definition at line 98 of file supervoxel_clustering.hpp.

References pcl::PCLBase< PointT >::deinitCompute(), and pcl::PCLBase< PointT >::initCompute().

template<typename PointT >
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr pcl::SupervoxelClustering< PointT >::getColoredCloud (  )  const [inline]

Returns an RGB colorized cloud showing superpixels Otherwise it returns an empty pointer.

Points that belong to the same supervoxel have the same color. But this function doesn't guarantee that different segments will have different color(it's random). Points that are unlabeled will be black

Note:
This will expand the label_colors_ vector so that it can accomodate all labels

Definition at line 549 of file supervoxel_clustering.hpp.

References pcl::PointCloud< PointT >::begin(), pcl::copyPointCloud(), pcl::PointCloud< PointT >::end(), pcl::PCLBase< PointT >::input_, and pcl::SupervoxelClustering< PointT >::VoxelData::owner_.

template<typename PointT >
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr pcl::SupervoxelClustering< PointT >::getColoredVoxelCloud (  )  const [inline]

Returns an RGB colorized voxelized cloud showing superpixels Otherwise it returns an empty pointer.

Points that belong to the same supervoxel have the same color. But this function doesn't guarantee that different segments will have different color(it's random). Points that are unlabeled will be black

Note:
This will expand the label_colors_ vector so that it can accomodate all labels

Definition at line 579 of file supervoxel_clustering.hpp.

References pcl::PointCloud< PointT >::begin(), pcl::copyPointCloud(), and pcl::PointCloud< PointT >::end().

template<typename PointT >
pcl::PointCloud< pcl::PointXYZL >::Ptr pcl::SupervoxelClustering< PointT >::getLabeledCloud (  )  const [inline]

Returns labeled cloud Points that belong to the same supervoxel have the same label.

Labels for segments start from 1, unlabled points have label 0

Definition at line 632 of file supervoxel_clustering.hpp.

References pcl::PointCloud< PointT >::begin(), pcl::copyPointCloud(), pcl::PointCloud< PointT >::end(), pcl::PCLBase< PointT >::input_, and pcl::SupervoxelClustering< PointT >::VoxelData::owner_.

template<typename PointT >
pcl::PointCloud< pcl::PointXYZL >::Ptr pcl::SupervoxelClustering< PointT >::getLabeledVoxelCloud (  )  const [inline]

Returns labeled voxelized cloud Points that belong to the same supervoxel have the same label.

Labels for segments start from 1, unlabled points have label 0

Definition at line 610 of file supervoxel_clustering.hpp.

References pcl::PointCloud< PointT >::begin(), pcl::copyPointCloud(), and pcl::PointCloud< PointT >::end().

template<typename PointT >
int pcl::SupervoxelClustering< PointT >::getMaxLabel (  )  const [inline]

Returns the current maximum (highest) label.

Definition at line 752 of file supervoxel_clustering.hpp.

template<typename PointT >
float pcl::SupervoxelClustering< PointT >::getSeedResolution (  )  const [inline]

Get the resolution of the octree seed voxels.

Definition at line 694 of file supervoxel_clustering.hpp.

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::getSupervoxelAdjacency ( std::multimap< uint32_t, uint32_t > &  label_adjacency  )  const [inline]

Get a multimap which gives supervoxel adjacency.

Parameters:
[out] label_adjacency Multi-Map which maps a supervoxel label to all adjacent supervoxel labels

Definition at line 530 of file supervoxel_clustering.hpp.

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::getSupervoxelAdjacencyList ( VoxelAdjacencyList adjacency_list_arg  )  const [inline]

Gets the adjacency list (Boost Graph library) which gives connections between supervoxels.

Parameters:
[out] adjacency_list_arg BGL graph where supervoxel labels are vertices, edges are touching relationships

Definition at line 479 of file supervoxel_clustering.hpp.

template<typename PointT >
pcl::PointCloud< PointT >::Ptr pcl::SupervoxelClustering< PointT >::getVoxelCentroidCloud (  )  const [inline]

Returns a deep copy of the voxel centroid cloud.

Definition at line 601 of file supervoxel_clustering.hpp.

References pcl::copyPointCloud().

template<typename PointT >
float pcl::SupervoxelClustering< PointT >::getVoxelResolution (  )  const [inline]

Get the resolution of the octree voxels.

Definition at line 679 of file supervoxel_clustering.hpp.

template<typename PointT >
pcl::PointCloud< pcl::PointNormal >::Ptr pcl::SupervoxelClustering< PointT >::makeSupervoxelNormalCloud ( std::map< uint32_t, typename Supervoxel< PointT >::Ptr > &  supervoxel_clusters  )  [inline, static]

Static helper function which returns a pointcloud of normals for the input supervoxels.

Parameters:
[in] supervoxel_clusters Supervoxel cluster map coming from this class
Returns:
Cloud of PointNormals of the supervoxels

Definition at line 662 of file supervoxel_clustering.hpp.

References pcl::PointCloud< PointT >::begin(), and pcl::PointCloud< PointT >::resize().

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::refineSupervoxels ( int  num_itr,
std::map< uint32_t, typename Supervoxel< PointT >::Ptr > &  supervoxel_clusters 
) [inline, virtual]

This method refines the calculated supervoxels - may only be called after extract.

Parameters:
[in] num_itr The number of iterations of refinement to be done (2 or 3 is usually sufficient)
[out] supervoxel_clusters The resulting refined supervoxels

Definition at line 150 of file supervoxel_clustering.hpp.

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::setColorImportance ( float  val  )  [inline]

Set the importance of color for supervoxels.

Definition at line 709 of file supervoxel_clustering.hpp.

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::setInputCloud ( typename pcl::PointCloud< PointT >::ConstPtr  cloud  )  [inline, virtual]

This method sets the cloud to be supervoxelized.

Parameters:
[in] cloud The cloud to be supervoxelize

Definition at line 71 of file supervoxel_clustering.hpp.

References pcl::PCLBase< PointT >::input_, and pcl::PointCloud< PointT >::size().

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::setNormalCloud ( typename NormalCloudT::ConstPtr  normal_cloud  )  [inline, virtual]

This method sets the normals to be used for supervoxels (should be same size as input cloud).

Parameters:
[in] cloud The input normals

Definition at line 85 of file supervoxel_clustering.hpp.

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::setNormalImportance ( float  val  )  [inline]

Set the importance of scalar normal product for supervoxels.

Definition at line 723 of file supervoxel_clustering.hpp.

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::setSeedResolution ( float  seed_resolution  )  [inline]

Set the resolution of the octree seed voxels.

Definition at line 701 of file supervoxel_clustering.hpp.

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::setSpatialImportance ( float  val  )  [inline]

Set the importance of spatial distance for supervoxels.

Definition at line 716 of file supervoxel_clustering.hpp.

template<typename PointT >
void pcl::SupervoxelClustering< PointT >::setVoxelResolution ( float  resolution  )  [inline]

Set the resolution of the octree voxels.

Definition at line 686 of file supervoxel_clustering.hpp.


Friends And Related Function Documentation

template<typename PointT >
friend class SupervoxelHelper [friend]

Definition at line 125 of file supervoxel_clustering.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends