The PCL Block filter allows users to specify a block of Point Cloud Library
(PCL) operations on a PDAL PointView
, applying the necessary conversions
between PDAL and PCL point cloud representations.
This filter is under active development. The current implementation serves as a
proof of concept for linking PCL into PDAL and converting data. The PCL Block
filter creates a PCL Pipeline
object and passes it a single argument, the JSON
file containing the PCL block definition. After filtering, the resulting indices
can be retrieved and used to create a new PDAL PointView
containing only
those points that passed the filtering stages.
At this stage in its development, the PCL Pipeline
does not allow complex
operations that may change the point type (e.g., PointXYZ
to PointNormal
) or
alter points. We will continue to look into use cases that are of value and
feasible, but for now are limited primarily to PCL functions that filter or
segment the point cloud, returning a list of indices of the filtered points
(e.g., ground or object, noise or signal). The main reason for this design
decision is that we want to avoid converting all PointView
dimensions to the
PCL PointCloud
. In the case of an LAS reader, we may very well not want to
operate on fields such as return number, but we do not want to lose this
information post PCL filtering. The easy solution is to simply retain the index
between the PointView
and PointCloud
objects and update as necessary.
See also
See Filtering data with PCL for more on using the PCL Block including examples.
See 1 Draft PCL JSON Specification for complete details on the PCL Block JSON syntax and the filters available.
The PCL Block json object describes the filter chain to be constructed within PCL. Here is an example:
{
"pipeline":
{
"name": "PCL-Block-Name",
"help": "This is an example pipeline with two filters.",
"author": "mpg",
"filters":
[
{
"name": "FilterOne",
"setFooParameter": "value"
},
{
"name": "FilterTwo",
"setBarParameter": false,
"setBounds":
{
"upper": 42,
"lower": 17
}
}
]
}
}
The list of PCL filters that are accessible through the PCL Block depends on PCL
itself. PDAL is rather dumb in this respect, merely converting the PDAL
PointView
to a PCL PointCloud
object and passing the JSON filename. The
parsing of the JSON file and implementation of the PCL filters is entirely
embedded within the PCL Pipeline
.
A summary of the currently available filters is listed below. For full details of the filters and their parameters, see the 1 Draft PCL JSON Specification.
Adding a new PCL filter to the PCLBlock ecosystem is mostly a process of judicious copying and pasting.
applyMyFilter
to
PCLPipeline.h
.applyMyFilter
to PCLPipeline.hpp
.filters.pclblock.rst
.PCLBlockFilterTest.cpp
. Make sure each parameter is
independently verified.