Point Cloud Library (PCL)
1.13.1-dev
doc
tutorials
content
sources
iros2011
include
segmentation.h
1
#pragma once
2
3
#include "typedefs.h"
4
5
#include <pcl/ModelCoefficients.h>
6
#include <pcl/sample_consensus/method_types.h>
7
#include <pcl/sample_consensus/model_types.h>
8
#include <pcl/segmentation/sac_segmentation.h>
9
#include <pcl/filters/extract_indices.h>
10
#include <pcl/segmentation/extract_clusters.h>
11
12
13
/* Use SACSegmentation to find the dominant plane in the scene
14
* Inputs:
15
* input
16
* The input point cloud
17
* max_iterations
18
* The maximum number of RANSAC iterations to run
19
* distance_threshold
20
* The inlier/outlier threshold. Points within this distance
21
* from the hypothesized plane are scored as inliers.
22
* Return: A pointer to the ModelCoefficients (i.e., the 4 coefficients of the plane,
23
* represented in c0*x + c1*y + c2*z + c3 = 0 form)
24
*/
25
pcl::ModelCoefficients::Ptr
26
fitPlane (
const
PointCloudPtr & input,
float
distance_threshold,
float
max_iterations)
27
{
28
pcl::ModelCoefficients::Ptr
coefficients;
29
return
(coefficients);
30
}
31
32
/* Use SACSegmentation and an ExtractIndices filter to find the dominant plane and subtract it
33
* Inputs:
34
* input
35
* The input point cloud
36
* max_iterations
37
* The maximum number of RANSAC iterations to run
38
* distance_threshold
39
* The inlier/outlier threshold. Points within this distance
40
* from the hypothesized plane are scored as inliers.
41
* Return: A pointer to a new point cloud which contains only the non-plane points
42
*/
43
PointCloudPtr
44
findAndSubtractPlane (
const
PointCloudPtr & input,
float
distance_threshold,
float
max_iterations)
45
{
46
PointCloudPtr output;
47
return
(output);
48
}
49
50
/* Use EuclidieanClusterExtraction to group a cloud into contiguous clusters
51
* Inputs:
52
* input
53
* The input point cloud
54
* cluster_tolerance
55
* The maximum distance between neighboring points in a cluster
56
* min/max_cluster_size
57
* The minimum and maximum allowable cluster sizes
58
* Return (by reference): a vector of PointIndices containing the points indices in each cluster
59
*/
60
void
61
clusterObjects (
const
PointCloudPtr & input,
62
float
cluster_tolerance,
int
min_cluster_size,
int
max_cluster_size,
63
std::vector<pcl::PointIndices> & cluster_indices_out)
64
{
65
}
pcl::ModelCoefficients::Ptr
shared_ptr< ::pcl::ModelCoefficients > Ptr
Definition:
ModelCoefficients.h:20