3#include <pcl/filters/passthrough.h>
4#include <pcl/filters/voxel_grid.h>
5#include <pcl/filters/radius_outlier_removal.h>
11thresholdDepth (
const PointCloudPtr & input,
float min_depth,
float max_depth)
14 pass_through.setInputCloud (input);
15 pass_through.setFilterFieldName (
"z");
16 pass_through.setFilterLimits (min_depth, max_depth);
18 pass_through.filter (*thresholded);
25downsample (
const PointCloudPtr & input,
float leaf_size)
28 voxel_grid.setInputCloud (input);
29 voxel_grid.setLeafSize (leaf_size, leaf_size, leaf_size);
31 voxel_grid.filter (*downsampled);
38removeOutliers (
const PointCloudPtr & input,
float radius,
int min_neighbors)
41 radius_outlier_removal.setInputCloud (input);
42 radius_outlier_removal.setRadiusSearch (radius);
43 radius_outlier_removal.setMinNeighborsInRadius (min_neighbors);
45 radius_outlier_removal.filter (*inliers);
52applyFilters (
const PointCloudPtr & input,
float min_depth,
float max_depth,
float leaf_size,
float radius,
55 PointCloudPtr filtered;
56 filtered = thresholdDepth (input, min_depth, max_depth);
57 filtered = downsample (filtered, leaf_size);
58 filtered = removeOutliers (filtered, radius, min_neighbors);
Iterator class for point clouds with or without given indices.
PointCloud represents the base class in PCL for storing collections of 3D points.