Implements the Progressive Morphological Filter for segmentation of ground
points.

Note

filters.ground required PCL and has since been replaced by
filters.pmf, which is a native PDAL filter. ground has
been retained, but now calls filters.pmf under the hood as opposed to
filters.ground and is installed as a native PDAL kernel independent of the
PCL plugin. As such, the outputs shown in this tutorial may vary slightly, but
the underlying algorithm is identical.

The pdal ground kernel can be used to filter ground
returns, allowing the user to tweak filtering parameters at the command-line.

Let’s start by running pdalground with the default parameters.

$ pdal ground -i CSite1_orig-utm.laz -o CSite1_orig-utm-ground.laz

To get an idea of what’s happening during each iteration, you can optionally
increase the verbosity of the output. We’ll try -v4. Here we see a summary
of the parameters, along with height threshold, window size, and number of
remaining ground points.

The resulting filtered cloud can be seen in this top-down and front view. When
viewed from the side, it is apparent that there are a number of low noise
points that have fooled the PMF filter.

To address, we introduce an alternate way to call PMF, as part of a PCL
pipeline, where we preprocess with an outlier removal step. The command is
nearly identical, replacing ground with pcl and adding a pipeline JSON
specified with -p.

The result is noticeably cleaner in both the top-down and front views.

Unfortunately, you may notice that we still have a rather large building in the
lower right of the image. By tweaking the parameters slightly, in this case,
increasing the cell size, we can do a better job of removing such features.