39#ifndef PCL_SEGMENTATION_IMPL_SEEDED_HUE_SEGMENTATION_H_
40#define PCL_SEGMENTATION_IMPL_SEEDED_HUE_SEGMENTATION_H_
42#include <pcl/segmentation/seeded_hue_segmentation.h>
43#include <pcl/console/print.h>
44#include <pcl/search/organized.h>
45#include <pcl/search/kdtree.h>
56 if (tree->getInputCloud ()->size () != cloud.
size ())
58 PCL_ERROR(
"[pcl::seededHueSegmentation] Tree built for a different point cloud "
59 "dataset (%zu) than the input cloud (%zu)!\n",
60 static_cast<std::size_t
>(tree->getInputCloud()->size()),
61 static_cast<std::size_t
>(cloud.
size()));
91 PCL_ERROR(
"[pcl::seededHueSegmentation] radiusSearch returned error code -1\n");
134 if (tree->getInputCloud ()->size () != cloud.
size ())
136 PCL_ERROR(
"[pcl::seededHueSegmentation] Tree built for a different point cloud "
137 "dataset (%zu) than the input cloud (%zu)!\n",
138 static_cast<std::size_t
>(tree->getInputCloud()->size()),
139 static_cast<std::size_t
>(cloud.
size()));
169 PCL_ERROR(
"[pcl::seededHueSegmentation] radiusSearch returned error code -1\n");
219 if (
input_->isOrganized ())
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
PointCloudConstPtr input_
The input point cloud dataset.
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.
KdTreePtr tree_
A pointer to the spatial search object.
float delta_hue_
The allowed difference on the hue.
double cluster_tolerance_
The spatial cluster tolerance as a measure in the L2 Euclidean space.
void segment(PointIndices &indices_in, PointIndices &indices_out)
Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
OrganizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds.
shared_ptr< pcl::search::Search< PointT > > Ptr
void seededHueSegmentation(const PointCloud< PointXYZRGB > &cloud, const search::Search< PointXYZRGB >::Ptr &tree, float tolerance, PointIndices &indices_in, PointIndices &indices_out, float delta_hue=0.0)
Decompose a region of space into clusters based on the Euclidean distance between points.
void PointXYZRGBtoXYZHSV(const PointXYZRGB &in, PointXYZHSV &out)
Convert a XYZRGB point type to a XYZHSV.
IndicesAllocator<> Indices
Type used for indices in PCL.
A point structure representing Euclidean xyz coordinates, and the RGB color.