40 #ifndef PCL_REGION_GROWING_H_ 41 #define PCL_REGION_GROWING_H_ 43 #include <pcl/pcl_base.h> 44 #include <pcl/search/search.h> 45 #include <pcl/point_cloud.h> 60 template <
typename Po
intT,
typename NormalT>
93 setMinClusterSize (
int min_cluster_size);
101 setMaxClusterSize (
int max_cluster_size);
110 getSmoothModeFlag ()
const;
116 setSmoothModeFlag (
bool value);
120 getCurvatureTestFlag ()
const;
128 setCurvatureTestFlag (
bool value);
132 getResidualTestFlag ()
const;
141 setResidualTestFlag (
bool value);
145 getSmoothnessThreshold ()
const;
151 setSmoothnessThreshold (
float theta);
155 getResidualThreshold ()
const;
161 setResidualThreshold (
float residual);
165 getCurvatureThreshold ()
const;
171 setCurvatureThreshold (
float curvature);
175 getNumberOfNeighbours ()
const;
181 setNumberOfNeighbours (
unsigned int neighbour_number);
185 getSearchMethod ()
const;
191 setSearchMethod (
const KdTreePtr& tree);
195 getInputNormals ()
const;
202 setInputNormals (
const NormalPtr& norm);
209 extract (std::vector <pcl::PointIndices>& clusters);
234 getColoredCloudRGBA ();
242 prepareForSegmentation ();
248 findPointNeighbours ();
255 applySmoothRegionGrowingAlgorithm ();
262 growRegion (
int initial_seed,
int segment_number);
272 validatePoint (
int initial_seed,
int point,
int nghbr,
bool& is_a_seed)
const;
336 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
343 return (i.first < j.first);
347 #ifdef PCL_NO_PRECOMPILE 348 #include <pcl/segmentation/impl/region_growing.hpp> float theta_threshold_
Thershold used for testing the smoothness between points.
float residual_threshold_
Thershold used in residual test.
float curvature_threshold_
Thershold used in curvature test.
pcl::search::Search< PointT > KdTree
std::vector< int > num_pts_in_segment_
Tells how much points each segment contains.
unsigned int neighbour_number_
Number of neighbours to find.
bool residual_flag_
If set to true then residual test will be done during segmentation.
int min_pts_per_cluster_
Stores the minimum number of points that a cluster needs to contain in order to be considered valid...
int number_of_segments_
Stores the number of segments.
NormalPtr normals_
Contains normals of the points that will be segmented.
boost::shared_ptr< PointCloud< PointT > > Ptr
int max_pts_per_cluster_
Stores the maximum number of points that a cluster needs to contain in order to be considered valid...
Implements the well known Region Growing algorithm used for segmentation.
bool comparePair(std::pair< float, int > i, std::pair< float, int > j)
This function is used as a comparator for sorting.
std::vector< pcl::PointIndices > clusters_
After the segmentation it will contain the segments.
boost::shared_ptr< pcl::search::Search< PointT > > Ptr
Defines all the PCL implemented PointT point type structures.
pcl::PointCloud< PointT > PointCloud
std::vector< int > point_labels_
Point labels that tells to which segment each point belongs.
bool smooth_mode_flag_
Flag that signalizes if the smoothness constraint will be used.
bool normal_flag_
If set to true then normal/smoothness test will be done during segmentation.
KdTreePtr search_
Serch method that will be used for KNN.
pcl::PointCloud< NormalT > Normal
bool curvature_flag_
If set to true then curvature test will be done during segmentation.
std::vector< std::vector< int > > point_neighbours_
Contains neighbours of each point.