Point Cloud Library
The Point Cloud Library is an open-source library of algorithms for point cloud processing tasks and 3D geometry processing, such as occur in three-dimensional computer vision. The library contains algorithms for filtering, feature estimation, surface reconstruction, 3D registration, model fitting, object recognition, and segmentation. Each module is implemented as a smaller library that can be compiled separately. PCL has its own data format for storing point clouds - PCD, but also allows datasets to be loaded and saved in many other formats. It is written in C++ and released under the BSD license.
These algorithms have been used, for example, for perception in robotics to filter outliers from noisy data, stitch 3D point clouds together, segment relevant parts of a scene, extract keypoints and compute descriptors to recognize objects in the world based on their geometric appearance, and create surfaces from point clouds and visualize them.
PCL requires several third-party libraries to function, which must be installed. Most mathematical operations are implemented using the Eigen library. The visualization module for 3D point clouds is based on VTK. Boost is used for shared pointers and the FLANN library for quick k-nearest neighbor search. Additional libraries such as Qhull, OpenNI, or Qt are optional and extend PCL with additional features.
PCL is cross-platform software that runs on the most commonly used operating systems: Linux, Windows, macOS and Android. The library is fully integrated with the Robot Operating System and provides support for OpenMP and Intel Threading Building Blocks libraries for multi-core parallelism.
The library is constantly updated and expanded, and its use in various industries is constantly growing. For example, PCL participated in the Google Summer of Code 2020 initiative with three projects. One was the extension of PCL for use with Python using Pybind11.
A large number of examples and tutorials are available on the PCL website, either as C++ source files or as tutorials with a detailed description and explanation of the individual steps.
Applications
Point cloud library is widely used in many different fields, here are some examples:- stitching 3D point clouds together
- recognize 3D objects on their geometric appearance
- filtering and smoothing out noisy data
- create surfaces from point clouds
- aligning a previously captured model of an object to some newly captured data
- cluster recognition and 6DoF pose estimation
- point cloud streaming to mobile devices with real-time visualization
3rd party libraries
Mandatory libraries:
- Boost at least version 1.46.1. This set of C++ libraries is used for threading and mainly for shared pointers, so there is no need to re-copy data that is already in the system.
- Eigen is required at least in version 3.0.0. It is an open-source template library for linear algebra. Most mathematical operations in PCL are implemented with Eigen.
- FLANN in version 1.6.8 or higher. It is a library that performs a fast approximate nearest neighbor search in high dimensional spaces. In PCL, it is especially important in the kdtree module for fast k-nearest neighbor search operations.
- VTK - Visualization ToolKit at least version 5.6.1. Multi-platform software system for rendering 3D point cloud, modeling, image processing, volume rendering. Used in visualization module for point cloud rendering and visualization.
- QHULL in version >= 2011.1 implements computation of the convex hull, Delaunay triangulation, Voronoi diagram, and so on. In PCL it is used for convex/concave hull decomposition on the surface.
- OpenNI in version >= 1.1.0.25 provides a single unified interface to depth sensors. It is used to retrieve point clouds from devices.
- Qt version >= 4.6 is a cross-platform C++ framework used for developing applications with a graphical user interface.
- Googletest in version >= 1.6.0 is a C++ testing framework. In PCL, it is used to build test units.
PCD File Format
Versions
The PCD version is specified with the numbers 0.x in the header of each file. The official version in 2020 is PCD 0.7. The main difference compared to version 0.6 is that a new header - VIEWPOINT has been added. It specifies the information about the orientation of the sensor relative to the dataset.File structure
The PCD file is divided into two parts - header and data. The header has a precisely defined format and contains the necessary information about the point cloud data that are stored in it. The header must be encoded in ASCII, however, the data can be stored in ASCII or binary format. Thanks to the fact that the ASCII format is more human readable, it can be opened in standard software tools and easily edited.In version 0.7 the version of the PCD file is at the beginning of the header, followed by the name, size, and type of each dimension of the stored data. It also shows a number of points in the whole cloud and information about whether the point cloud dataset is organized or unorganized. The data type specifies in which format the point cloud data are stored. The header is followed by a set of points. Each point can be stored on a separate line or they are stored in an image-like organized structure. More detailed information about header entries can be found in . Below is an example of a PCD file. The order of header entries is important!
#.PCD v.7 - Point Cloud Data file format
VERSION.7
FIELDS x y z rgb
SIZE 4 4 4 4
TYPE F F F F
COUNT 1 1 1 1
WIDTH 213
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 213
DATA ascii
0.93773 0.33763 0 4.2108e+06
0.90805 0.35641 0 4.2108e+06
0.81915 0.32 0 4.2108e+06
0.97192 0.278 0 4.2108e+06
...
...
History
The development of the Point Cloud Library started in March 2010 at Willow Garage. The project initially resided on a sub domain of Willow Garage then moved to a new website www.pointclouds.org in March 2011. PCL's first official release was released two months later in May 2011.Modules
PCL is divided into several smaller code libraries that can be compiled separately. Some of the most important modules and their functions are described below.Filters
When scanning a 3D point cloud, errors and various deviations can occur, which causes noise in the data. This complicates the estimation of some local point cloud characteristics, such as surface normals. These inaccuracies can lead to significant errors in further processing and it is therefore advisable to remove them with a suitable filter. The pcl_filters library provides several useful filters for removing outliers and noise and also downsampling the data. Some of them use simple criteria to trim points, others use statistical analysis.- PassThrough filter - is used to filter points in one selected dimension. This means that it can cut off points that are not within the range specified by the user.
- VoxelGrid filter - creates a grid of voxels in a point cloud. The points inside each voxel are then approximated by their centroid. This leads to downsampling in the point cloud data.
- StatisticalOutlierRemoval filter - It removes noise from a point cloud dataset using statistical analysis techniques applied to each point's neighborhood and trim all points whose mean distances are outside a defined interval.
- RadiusOutlierRemoval filter - removes those points that have less than the selected number of neighbors in the defined neighborhood.
Features
One of the easiest implemented methods for estimating the surface normal is an analysis of the eigenvectors and eigenvalues of a covariance matrix created from the neighborhood of the point. Point Feature Histograms descriptors are an advanced feature representation and depend on normal estimations at each point. It generalizes the mean curvature around the point using a multidimensional histogram of values. Some of other descriptors in the library are Viewpoint Feature Histogram descriptor, NARF descriptors, Moment of inertia and eccentricity based descriptors, Globally Aligned Spatial Distribution descriptors, and more.
Segmentation
The pcl_segmentation library contains algorithms for segmenting a point cloud into different clusters. Clustering is often used to divide the cloud into individual parts, that can be further processed. There are implemented several classes, that support various segmentation methods:- Plane model segmentation - simple algorithm that finds all the points that support a plane model in the point cloud
- Euclidean clustering - creates clusters of points based on Euclidean distance
- Conditional Euclidean clustering - clustering points based on Euclidean distance and a user-defined condition
- Region growing segmentation - merge the points that are close enough in terms of the smoothness constraint
- Color-based region growing segmentation - same concept as the Region growing, but uses color instead of normals
- Min-Cut based binary segmentation - divides the cloud on foreground and background sets of points
- Difference of Normals Based Segmentation - scale based segmentation, finding points that belong within the scale parameters given
- Supervoxel clustering - generates volumetric over-segmentations of 3D point cloud data