42#include <pcl/pcl_base.h>
43#include <pcl/PointIndices.h>
44#include <pcl/segmentation/comparator.h>
57 template <
typename Po
intT,
typename Po
intLT>
123 findRoot (
const std::vector<unsigned>& runs,
unsigned index)
const
125 unsigned idx = index;
126 while (runs[idx] != idx)
135 Neighbor (
int dx,
int dy,
int didx)
148#ifdef PCL_NO_PRECOMPILE
149#include <pcl/segmentation/impl/organized_connected_component_segmentation.hpp>
Comparator is the base class for comparators that compare two points given some function.
shared_ptr< Comparator< PointT > > Ptr
shared_ptr< const Comparator< PointT > > ConstPtr
OrganizedConnectedComponentSegmentation allows connected components to be found within organized poin...
static void findLabeledRegionBoundary(int start_idx, PointCloudLPtr labels, pcl::PointIndices &boundary_indices)
Find the boundary points / contour of a connected component.
ComparatorConstPtr getComparator() const
Get the comparator.
unsigned findRoot(const std::vector< unsigned > &runs, unsigned index) const
typename PointCloudL::ConstPtr PointCloudLConstPtr
void setComparator(const ComparatorConstPtr &compare)
Provide a pointer to the comparator to be used for segmentation.
typename PointCloudL::Ptr PointCloudLPtr
void segment(pcl::PointCloud< PointLT > &labels, std::vector< pcl::PointIndices > &label_indices) const
Perform the connected component segmentation.
ComparatorConstPtr compare_
typename Comparator::ConstPtr ComparatorConstPtr
typename Comparator::Ptr ComparatorPtr
~OrganizedConnectedComponentSegmentation() override=default
Destructor for OrganizedConnectedComponentSegmentation.
OrganizedConnectedComponentSegmentation(const ComparatorConstPtr &compare)
Constructor for OrganizedConnectedComponentSegmentation.
PointCloudConstPtr input_
The input point cloud dataset.
typename PointCloud::Ptr PointCloudPtr
typename PointCloud::ConstPtr PointCloudConstPtr
IndicesPtr indices_
A pointer to the vector of point indices to use.
bool initCompute()
This method should get called before starting the actual computation.
bool deinitCompute()
This method should get called after finishing the actual computation.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.