Point Cloud Library (PCL)
1.9.1
|
Implements a supervoxel algorithm based on voxel structure, normals, and rgb values. More...
#include <pcl/segmentation/supervoxel_clustering.h>
Classes | |
class | VoxelData |
VoxelData is a structure used for storing data within a pcl::octree::OctreePointCloudAdjacencyContainer. More... | |
Public Member Functions | |
SupervoxelClustering (float voxel_resolution, float seed_resolution) | |
Constructor that sets default values for member variables. More... | |
SupervoxelClustering (float voxel_resolution, float seed_resolution, bool) | |
virtual | ~SupervoxelClustering () |
This destructor destroys the cloud, normals and search method used for finding neighbors. More... | |
void | setVoxelResolution (float resolution) |
Set the resolution of the octree voxels. More... | |
float | getVoxelResolution () const |
Get the resolution of the octree voxels. More... | |
void | setSeedResolution (float seed_resolution) |
Set the resolution of the octree seed voxels. More... | |
float | getSeedResolution () const |
Get the resolution of the octree seed voxels. More... | |
void | setColorImportance (float val) |
Set the importance of color for supervoxels. More... | |
void | setSpatialImportance (float val) |
Set the importance of spatial distance for supervoxels. More... | |
void | setNormalImportance (float val) |
Set the importance of scalar normal product for supervoxels. More... | |
void | setUseSingleCameraTransform (bool val) |
Set whether or not to use the single camera transform. More... | |
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. More... | |
virtual void | setInputCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud) |
This method sets the cloud to be supervoxelized. More... | |
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) More... | |
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. More... | |
pcl::PointCloud< PointXYZRGBA >::Ptr | getColoredCloud () const |
Returns an RGB colorized cloud showing superpixels Otherwise it returns an empty pointer. More... | |
pcl::PointCloud< PointT >::Ptr | getVoxelCentroidCloud () const |
Returns a deep copy of the voxel centroid cloud. More... | |
pcl::PointCloud< PointXYZL >::Ptr | getLabeledCloud () const |
Returns labeled cloud Points that belong to the same supervoxel have the same label. More... | |
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr | getColoredVoxelCloud () const |
Returns an RGB colorized voxelized cloud showing superpixels Otherwise it returns an empty pointer. More... | |
pcl::PointCloud< pcl::PointXYZL >::Ptr | getLabeledVoxelCloud () const |
Returns labeled voxelized cloud Points that belong to the same supervoxel have the same label. More... | |
void | getSupervoxelAdjacencyList (VoxelAdjacencyList &adjacency_list_arg) const |
Gets the adjacency list (Boost Graph library) which gives connections between supervoxels. More... | |
void | getSupervoxelAdjacency (std::multimap< uint32_t, uint32_t > &label_adjacency) const |
Get a multimap which gives supervoxel adjacency. More... | |
int | getMaxLabel () const |
Returns the current maximum (highest) label. More... | |
![]() | |
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 PointT & | operator[] (size_t pos) const |
Override PointCloud operator[] to shorten code. More... | |
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. More... | |
Friends | |
class | SupervoxelHelper |
void | boost::checked_delete (const typename pcl::SupervoxelClustering< PointT >::SupervoxelHelper *) |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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... | |
Implements a supervoxel algorithm based on voxel structure, normals, and rgb values.
Definition at line 123 of file supervoxel_clustering.h.
typedef VoxelAdjacencyList::edge_descriptor pcl::SupervoxelClustering< PointT >::EdgeID |
Definition at line 183 of file supervoxel_clustering.h.
typedef boost::shared_ptr<std::vector<int> > pcl::SupervoxelClustering< PointT >::IndicesPtr |
Definition at line 175 of file supervoxel_clustering.h.
typedef pcl::search::KdTree<PointT> pcl::SupervoxelClustering< PointT >::KdTreeT |
Definition at line 174 of file supervoxel_clustering.h.
typedef pcl::octree::OctreePointCloudAdjacencyContainer<PointT, VoxelData> pcl::SupervoxelClustering< PointT >::LeafContainerT |
Definition at line 167 of file supervoxel_clustering.h.
typedef std::vector<LeafContainerT*> pcl::SupervoxelClustering< PointT >::LeafVectorT |
Definition at line 168 of file supervoxel_clustering.h.
typedef pcl::PointCloud<Normal> pcl::SupervoxelClustering< PointT >::NormalCloudT |
Definition at line 171 of file supervoxel_clustering.h.
typedef pcl::octree::OctreePointCloudAdjacency<PointT, LeafContainerT> pcl::SupervoxelClustering< PointT >::OctreeAdjacencyT |
Definition at line 172 of file supervoxel_clustering.h.
typedef pcl::octree::OctreePointCloudSearch<PointT> pcl::SupervoxelClustering< PointT >::OctreeSearchT |
Definition at line 173 of file supervoxel_clustering.h.
typedef pcl::PointCloud<PointT> pcl::SupervoxelClustering< PointT >::PointCloudT |
Definition at line 170 of file supervoxel_clustering.h.
typedef boost::adjacency_list<boost::setS, boost::setS, boost::undirectedS, uint32_t, float> pcl::SupervoxelClustering< PointT >::VoxelAdjacencyList |
Definition at line 181 of file supervoxel_clustering.h.
typedef VoxelAdjacencyList::vertex_descriptor pcl::SupervoxelClustering< PointT >::VoxelID |
Definition at line 182 of file supervoxel_clustering.h.
pcl::SupervoxelClustering< PointT >::SupervoxelClustering | ( | float | voxel_resolution, |
float | seed_resolution | ||
) |
Constructor that sets default values for member variables.
[in] | voxel_resolution | The resolution (in meters) of voxels used |
[in] | seed_resolution | The average size (in meters) of resulting supervoxels |
Definition at line 47 of file supervoxel_clustering.hpp.
pcl::SupervoxelClustering< PointT >::SupervoxelClustering | ( | float | voxel_resolution, |
float | seed_resolution, | ||
bool | |||
) |
Definition at line 62 of file supervoxel_clustering.hpp.
|
virtual |
This destructor destroys the cloud, normals and search method used for finding neighbors.
In other words it frees memory.
Definition at line 77 of file supervoxel_clustering.hpp.
|
virtual |
This method launches the segmentation algorithm and returns the supervoxels that were obtained during the segmentation.
[out] | supervoxel_clusters | A map of labels to pointers to supervoxel structures |
Definition at line 111 of file supervoxel_clustering.hpp.
References pcl::PCLBase< PointT >::deinitCompute(), and pcl::PCLBase< PointT >::initCompute().
|
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
Definition at line 279 of file supervoxel_clustering.h.
|
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
Definition at line 304 of file supervoxel_clustering.h.
pcl::PointCloud< pcl::PointXYZL >::Ptr pcl::SupervoxelClustering< PointT >::getLabeledCloud | ( | ) | const |
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 597 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_.
pcl::PointCloud< pcl::PointXYZL >::Ptr pcl::SupervoxelClustering< PointT >::getLabeledVoxelCloud | ( | ) | const |
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 575 of file supervoxel_clustering.hpp.
References pcl::PointCloud< PointT >::begin(), pcl::copyPointCloud(), and pcl::PointCloud< PointT >::end().
int pcl::SupervoxelClustering< PointT >::getMaxLabel | ( | ) | const |
Returns the current maximum (highest) label.
Definition at line 703 of file supervoxel_clustering.hpp.
References pcl::SupervoxelClustering< PointT >::VoxelData::getPoint().
float pcl::SupervoxelClustering< PointT >::getSeedResolution | ( | ) | const |
Get the resolution of the octree seed voxels.
Definition at line 659 of file supervoxel_clustering.hpp.
void pcl::SupervoxelClustering< PointT >::getSupervoxelAdjacency | ( | std::multimap< uint32_t, uint32_t > & | label_adjacency | ) | const |
Get a multimap which gives supervoxel adjacency.
[out] | label_adjacency | Multi-Map which maps a supervoxel label to all adjacent supervoxel labels |
Definition at line 549 of file supervoxel_clustering.hpp.
void pcl::SupervoxelClustering< PointT >::getSupervoxelAdjacencyList | ( | VoxelAdjacencyList & | adjacency_list_arg | ) | const |
Gets the adjacency list (Boost Graph library) which gives connections between supervoxels.
[out] | adjacency_list_arg | BGL graph where supervoxel labels are vertices, edges are touching relationships |
Definition at line 498 of file supervoxel_clustering.hpp.
pcl::PointCloud< PointT >::Ptr pcl::SupervoxelClustering< PointT >::getVoxelCentroidCloud | ( | ) | const |
Returns a deep copy of the voxel centroid cloud.
Definition at line 566 of file supervoxel_clustering.hpp.
References pcl::copyPointCloud().
float pcl::SupervoxelClustering< PointT >::getVoxelResolution | ( | ) | const |
Get the resolution of the octree voxels.
Definition at line 644 of file supervoxel_clustering.hpp.
|
static |
Static helper function which returns a pointcloud of normals for the input supervoxels.
[in] | supervoxel_clusters | Supervoxel cluster map coming from this class |
Definition at line 627 of file supervoxel_clustering.hpp.
References pcl::PointCloud< PointT >::begin(), and pcl::PointCloud< PointT >::resize().
|
virtual |
This method refines the calculated supervoxels - may only be called after extract.
[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 163 of file supervoxel_clustering.hpp.
References pcl::octree::OctreePointCloud< PointT, LeafContainerT, BranchContainerT >::addPointsFromInputCloud(), pcl::computePointNormal(), pcl::SupervoxelClustering< PointT >::VoxelData::curvature_, pcl::geometry::distance(), pcl::SupervoxelClustering< PointT >::VoxelData::distance_, pcl::flipNormalTowardsViewpoint(), pcl::octree::OctreePointCloudAdjacencyContainer< PointInT, DataT >::getData(), pcl::octree::OctreePointCloud< PointT, LeafContainerT, BranchContainerT >::getOccupiedVoxelCenters(), pcl::SupervoxelClustering< PointT >::VoxelData::getPoint(), pcl::SupervoxelClustering< PointT >::VoxelData::idx_, pcl::PCLBase< PointT >::input_, pcl::search::KdTree< PointT, Tree >::nearestKSearch(), pcl::SupervoxelClustering< PointT >::VoxelData::normal_, pcl::SupervoxelClustering< PointT >::VoxelData::owner_, pcl::search::KdTree< PointT, Tree >::radiusSearch(), pcl::SupervoxelClustering< PointT >::VoxelData::rgb_, pcl::octree::OctreePointCloud< PointT, LeafContainerT, BranchContainerT >::setInputCloud(), pcl::search::KdTree< PointT, Tree >::setInputCloud(), pcl::SupervoxelClustering< PointT >::SupervoxelHelper, and pcl::SupervoxelClustering< PointT >::VoxelData::xyz_.
void pcl::SupervoxelClustering< PointT >::setColorImportance | ( | float | val | ) |
Set the importance of color for supervoxels.
Definition at line 674 of file supervoxel_clustering.hpp.
|
virtual |
This method sets the cloud to be supervoxelized.
[in] | cloud | The cloud to be supervoxelize |
Definition at line 84 of file supervoxel_clustering.hpp.
References pcl::PCLBase< PointT >::input_, and pcl::PointCloud< PointT >::size().
|
virtual |
This method sets the normals to be used for supervoxels (should be same size as input cloud)
[in] | normal_cloud | The input normals |
Definition at line 98 of file supervoxel_clustering.hpp.
void pcl::SupervoxelClustering< PointT >::setNormalImportance | ( | float | val | ) |
Set the importance of scalar normal product for supervoxels.
Definition at line 688 of file supervoxel_clustering.hpp.
void pcl::SupervoxelClustering< PointT >::setSeedResolution | ( | float | seed_resolution | ) |
Set the resolution of the octree seed voxels.
Definition at line 666 of file supervoxel_clustering.hpp.
void pcl::SupervoxelClustering< PointT >::setSpatialImportance | ( | float | val | ) |
Set the importance of spatial distance for supervoxels.
Definition at line 681 of file supervoxel_clustering.hpp.
void pcl::SupervoxelClustering< PointT >::setUseSingleCameraTransform | ( | bool | val | ) |
Set whether or not to use the single camera transform.
Definition at line 695 of file supervoxel_clustering.hpp.
void pcl::SupervoxelClustering< PointT >::setVoxelResolution | ( | float | resolution | ) |
Set the resolution of the octree voxels.
Definition at line 651 of file supervoxel_clustering.hpp.
|
friend |
|
friend |
Definition at line 126 of file supervoxel_clustering.h.
Referenced by pcl::SupervoxelClustering< PointT >::refineSupervoxels().