|
Point Cloud Library (PCL) 1.15.0
|
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 Types | |
| using | LeafContainerT = pcl::octree::OctreePointCloudAdjacencyContainer<PointT, VoxelData> |
| using | LeafVectorT = std::vector<LeafContainerT *> |
| using | PointCloudT = pcl::PointCloud<PointT> |
| using | NormalCloudT = pcl::PointCloud<Normal> |
| using | OctreeAdjacencyT = pcl::octree::OctreePointCloudAdjacency<PointT, LeafContainerT> |
| using | OctreeSearchT = pcl::octree::OctreePointCloudSearch<PointT> |
| using | KdTreeT = pcl::search::KdTree<PointT> |
| using | IndicesPtr = pcl::IndicesPtr |
| using | VoxelAdjacencyList = boost::adjacency_list<boost::setS, boost::setS, boost::undirectedS, std::uint32_t, float> |
| using | VoxelID = VoxelAdjacencyList::vertex_descriptor |
| using | EdgeID = VoxelAdjacencyList::edge_descriptor |
| 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 | |
| SupervoxelClustering (float voxel_resolution, float seed_resolution) | |
| Constructor that sets default values for member variables. | |
| ~SupervoxelClustering () override | |
| 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. | |
| void | setUseSingleCameraTransform (bool val) |
| Set whether or not to use the single camera transform. | |
| virtual void | extract (std::map< std::uint32_t, typename Supervoxel< PointT >::Ptr > &supervoxel_clusters) |
| This method launches the segmentation algorithm and returns the supervoxels that were obtained during the segmentation. | |
| void | setInputCloud (const typename pcl::PointCloud< PointT >::ConstPtr &cloud) override |
| 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< std::uint32_t, typename Supervoxel< PointT >::Ptr > &supervoxel_clusters) |
| This method refines the calculated supervoxels - may only be called after extract. | |
| 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::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< std::uint32_t, std::uint32_t > &label_adjacency) const |
| Get a multimap which gives supervoxel adjacency. | |
| int | getMaxLabel () const |
| Returns the current maximum (highest) label. | |
| 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 PointT & | operator[] (std::size_t pos) const |
| Override PointCloud operator[] to shorten code. | |
Static Public Member Functions | |
| static pcl::PointCloud< pcl::PointNormal >::Ptr | makeSupervoxelNormalCloud (std::map< std::uint32_t, typename Supervoxel< PointT >::Ptr > &supervoxel_clusters) |
| Static helper function which returns a pointcloud of normals for the input supervoxels. | |
Friends | |
| class | SupervoxelHelper |
| void | boost::checked_delete (const typename pcl::SupervoxelClustering< PointT >::SupervoxelHelper *) |
Additional Inherited Members | |
| 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 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. | |
Implements a supervoxel algorithm based on voxel structure, normals, and rgb values.
Definition at line 126 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::EdgeID = VoxelAdjacencyList::edge_descriptor |
Definition at line 208 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::IndicesPtr = pcl::IndicesPtr |
Definition at line 200 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::KdTreeT = pcl::search::KdTree<PointT> |
Definition at line 199 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::LeafContainerT = pcl::octree::OctreePointCloudAdjacencyContainer<PointT, VoxelData> |
Definition at line 192 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::LeafVectorT = std::vector<LeafContainerT *> |
Definition at line 193 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::NormalCloudT = pcl::PointCloud<Normal> |
Definition at line 196 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::OctreeAdjacencyT = pcl::octree::OctreePointCloudAdjacency<PointT, LeafContainerT> |
Definition at line 197 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::OctreeSearchT = pcl::octree::OctreePointCloudSearch<PointT> |
Definition at line 198 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::PointCloudT = pcl::PointCloud<PointT> |
Definition at line 195 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::VoxelAdjacencyList = boost::adjacency_list<boost::setS, boost::setS, boost::undirectedS, std::uint32_t, float> |
Definition at line 206 of file supervoxel_clustering.h.
| using pcl::SupervoxelClustering< PointT >::VoxelID = VoxelAdjacencyList::vertex_descriptor |
Definition at line 207 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 48 of file supervoxel_clustering.hpp.
|
overridedefault |
This destructor destroys the cloud, normals and search method used for finding neighbors.
In other words it frees memory.
References extract(), getLabeledCloud(), getLabeledVoxelCloud(), getMaxLabel(), getSeedResolution(), getSupervoxelAdjacency(), getSupervoxelAdjacencyList(), getVoxelCentroidCloud(), getVoxelResolution(), makeSupervoxelNormalCloud(), refineSupervoxels(), setColorImportance(), setInputCloud(), setNormalCloud(), setNormalImportance(), setSeedResolution(), setSpatialImportance(), setUseSingleCameraTransform(), and setVoxelResolution().
|
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 91 of file supervoxel_clustering.hpp.
References pcl::PCLBase< PointT >::deinitCompute(), and pcl::PCLBase< PointT >::initCompute().
Referenced by ~SupervoxelClustering().
| 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, unlabeled points have label 0
Definition at line 576 of file supervoxel_clustering.hpp.
References pcl::PointCloud< PointT >::begin(), pcl::copyPointCloud(), pcl::PointCloud< PointT >::end(), pcl::octree::OctreePointCloudAdjacencyContainer< PointInT, DataT >::getData(), pcl::PCLBase< PointT >::input_, pcl::isFinite(), and pcl::SupervoxelClustering< PointT >::VoxelData::owner_.
Referenced by ~SupervoxelClustering().
| 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, unlabeled points have label 0
Definition at line 554 of file supervoxel_clustering.hpp.
References pcl::PointCloud< PointT >::begin(), pcl::copyPointCloud(), and pcl::PointCloud< PointT >::end().
Referenced by ~SupervoxelClustering().
| int pcl::SupervoxelClustering< PointT >::getMaxLabel | ( | ) | const |
Returns the current maximum (highest) label.
Definition at line 677 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| float pcl::SupervoxelClustering< PointT >::getSeedResolution | ( | ) | const |
Get the resolution of the octree seed voxels.
Definition at line 633 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| void pcl::SupervoxelClustering< PointT >::getSupervoxelAdjacency | ( | std::multimap< std::uint32_t, std::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 528 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| 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 477 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| pcl::PointCloud< PointT >::Ptr pcl::SupervoxelClustering< PointT >::getVoxelCentroidCloud | ( | ) | const |
Returns a deep copy of the voxel centroid cloud.
Definition at line 545 of file supervoxel_clustering.hpp.
References pcl::copyPointCloud().
Referenced by ~SupervoxelClustering().
| float pcl::SupervoxelClustering< PointT >::getVoxelResolution | ( | ) | const |
Get the resolution of the octree voxels.
Definition at line 618 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
|
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 603 of file supervoxel_clustering.hpp.
References pcl::PointCloud< PointT >::begin(), and pcl::PointCloud< PointT >::resize().
Referenced by ~SupervoxelClustering().
|
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 143 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| void pcl::SupervoxelClustering< PointT >::setColorImportance | ( | float | val | ) |
Set the importance of color for supervoxels.
Definition at line 648 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
|
override |
This method sets the cloud to be supervoxelized.
| [in] | cloud | The cloud to be supervoxelize |
Definition at line 64 of file supervoxel_clustering.hpp.
References pcl::PointCloud< PointT >::empty(), and pcl::PCLBase< PointT >::input_.
Referenced by ~SupervoxelClustering().
|
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 78 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| void pcl::SupervoxelClustering< PointT >::setNormalImportance | ( | float | val | ) |
Set the importance of scalar normal product for supervoxels.
Definition at line 662 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| void pcl::SupervoxelClustering< PointT >::setSeedResolution | ( | float | seed_resolution | ) |
Set the resolution of the octree seed voxels.
Definition at line 640 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| void pcl::SupervoxelClustering< PointT >::setSpatialImportance | ( | float | val | ) |
Set the importance of spatial distance for supervoxels.
Definition at line 655 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| void pcl::SupervoxelClustering< PointT >::setUseSingleCameraTransform | ( | bool | val | ) |
Set whether or not to use the single camera transform.
Definition at line 669 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
| void pcl::SupervoxelClustering< PointT >::setVoxelResolution | ( | float | resolution | ) |
Set the resolution of the octree voxels.
Definition at line 625 of file supervoxel_clustering.hpp.
Referenced by ~SupervoxelClustering().
|
friend |
References PCL_MAKE_ALIGNED_OPERATOR_NEW.
|
friend |
Definition at line 130 of file supervoxel_clustering.h.