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>
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. More... |
|
~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 ()=default |
Destructor. More... |
|
virtual void | setInputCloud (const PointCloudConstPtr &cloud) |
Provide a pointer to the input dataset. More... |
|
const PointCloudConstPtr | 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 (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. More... |
|
IndicesPtr | getIndices () |
Get a pointer to the vector of indices used. More... |
|
const IndicesConstPtr | getIndices () const |
Get a pointer to the vector of indices used. More... |
|
const PointT & | operator[] (std::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... |
|
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.
Definition at line 58 of file organized_connected_component_segmentation.h.
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::Comparator = pcl::Comparator<PointT> |
Definition at line 74 of file organized_connected_component_segmentation.h.
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::ComparatorConstPtr = typename Comparator::ConstPtr |
Definition at line 76 of file organized_connected_component_segmentation.h.
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::ComparatorPtr = typename Comparator::Ptr |
Definition at line 75 of file organized_connected_component_segmentation.h.
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloud = pcl::PointCloud<PointT> |
Definition at line 66 of file organized_connected_component_segmentation.h.
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudConstPtr = typename PointCloud::ConstPtr |
Definition at line 68 of file organized_connected_component_segmentation.h.
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudL = pcl::PointCloud<PointLT> |
Definition at line 70 of file organized_connected_component_segmentation.h.
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudLConstPtr = typename PointCloudL::ConstPtr |
Definition at line 72 of file organized_connected_component_segmentation.h.
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudLPtr = typename PointCloudL::Ptr |
Definition at line 71 of file organized_connected_component_segmentation.h.
using pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::PointCloudPtr = typename PointCloud::Ptr |
Definition at line 67 of file organized_connected_component_segmentation.h.
| inline |
Constructor for OrganizedConnectedComponentSegmentation.
[in] | compare | A 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.
| inline |
Destructor for OrganizedConnectedComponentSegmentation.
Definition at line 88 of file organized_connected_component_segmentation.h.
| static |
Find the boundary points / contour of a connected component.
Directions: 1 2 3 0 x 4 7 6 5 e.g.
[in] | start_idx | the first (lowest) index of the connected component for which a boundary should be returned |
[in] | labels | the Label cloud produced by segmentation |
[out] | boundary_indices | the 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< pcl::PointXYZRGBA, pcl::Normal, pcl::Label >::segment(), and pcl::OrganizedMultiPlaneSegmentation< pcl::PointXYZRGBA, pcl::Normal, pcl::Label >::segmentAndRefine().
| inlineprotected |
Definition at line 125 of file organized_connected_component_segmentation.h.
| inline |
Get the comparator.
Definition at line 103 of file organized_connected_component_segmentation.h.
References pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::compare_.
void pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::segment | ( | pcl::PointCloud< PointLT > & | labels, |
std::vector< pcl::PointIndices > & | label_indices | ||
) | const |
Perform the connected component segmentation.
[out] | labels | a PointCloud of labels: each connected component will have a unique id. |
[out] | label_indices | a vector of PointIndices corresponding to each label / component id. |
Definition at line 118 of file organized_connected_component_segmentation.hpp.
References pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::push_back(), pcl::PointCloud< PointT >::resize(), and pcl::PointCloud< PointT >::width.
Referenced by pcl::OrganizedMultiPlaneSegmentation< pcl::PointXYZRGBA, pcl::Normal, pcl::Label >::segment().
| inline |
Provide a pointer to the comparator to be used for segmentation.
[in] | compare | the comparator |
Definition at line 96 of file organized_connected_component_segmentation.h.
References pcl::OrganizedConnectedComponentSegmentation< PointT, PointLT >::compare_.
| protected |
© 2009–2012, Willow Garage, Inc.
© 2012–, Open Perception, Inc.
Licensed under the BSD License.
https://pointclouds.org/documentation/classpcl_1_1_organized_connected_component_segmentation.html