Menu

PCL_Feature_Cloud

DDrexl

Summary

This is a static library to wrap PCL's often used functionality like filtering, surface normal calculation and feature estimation.
The FeatureCloud class works like a handle. First, a pcl::PointCloud::Ptr is assigned to it. Then, any operation performed by the FeatureCloud class will take effect on the referenced cloud. After that, it is possible to assign a different point cloud to the handle class.

Usage

To use this library in your program load it's header with:

#include "pcl_feature_cloud.h"

The FeatureCloud Class is now available. It is initialized like this:

FeatureCloud MyFeatureCloud("my_feature_clouds_name");

To process a PointCloud you have to load it into the feature cloud.
If you want to load the cloud from memory, given an existing pcl::PointCloud::Ptr, do:

MyFeatureCloud.setInputCloud(pcl_pointcloud_ptr);

If you want to load the cloud from file, given the file's name as std::string, do:

MyFeatureCloud.loadInputCloud(cloudfile_name);

Now it's possible to apply filters to the cloud by using the apply* methods, for example:

MyFeatureCloud.applyVoxelGrid(0.002);

which is a voxel grid filter with a leaf size of 2mm³.

To get a pointer to the feature cloud's content, do one of the following:

MyFeatureCloud.getPointCloud();
MyFeatureCloud.getSurfaceNormals();
MyFeatureCloud.getLocalFeatures();

Again: Every filter changes the referenced cloud in-place, so for the voxel grid example the number of the cloud's points would decrease.
If the cloud's state before the filtering is important, please keep a copy of the cloud somewhere because it can't be restored, except it was loaded from file.

List of Methods

Filter methods start with "apply".

applyPassThrough - everything inside the given xyz-thresholds stays in the cloud

Arguments:
x_lower, x_upper, y_lower, y_upper, z_lower, z_upper - the respective thresholds


applyVoxelGrid - the space is quantised into cubes

Arguments:
voxel_grid_size - the edge length of the cubes

Description:
If there is more than one point inside a cube, they all collapse into their common mean


applyRemoveOutlier - single Points are removed

Arguments:
neighbors - number of neighbors looked for
deviation_thresh - deviation threshold

Description:
For every point in the cloud, the distances to it's N(="neighbors") nearest neighbors are computed to get a distance distribution, which is used for decision. If a point's connectivity is more than "deviation_thres" times of standard deviation away from the mean point-to-point distance, it is removed.


applyMLS - moving least squares algorithm for surface smoothing

Arguments:
mls_radius - search radius for the mls-algorithm


computeSurfaceNormals

Arguments:
normal_radius - search radius


computeLocalFeatures

Arguments:
feature_radius - search radius


Planned Changes

  • Save PointClouds to file again
  • Make a snapshot function to prevent loss of cloud info by filtering

Requirements

Compiling and Running:

  • PCL 1.3

Related

Wiki: Code Overview