<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>FFT Based Airborne LIDAR Classification with Open3D and Numpy/Scipy</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Peter Szutor</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Debrecen Faculty of Informatics Hungary</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <fpage>29</fpage>
      <lpage>31</lpage>
      <abstract>
        <p>The classification of the airborne LIDAR (also referred to ALS) pointclouds is a frequently used operation. The recently used algorithms use machine learning algorithms (like SVM), but teaching this algorithms often may be involved. In many instances we need to write a special application for working with our data. For the fast developing we need a very useful programming language (python+numpy is the best), and a C based point cloud library, for the fast execution. Open3d is a modern library for 3D data processing, including point clouds,meshes, RGBD pictures, it has good highly optimized algorithms, data types, IO functions and supports visualisation; and it has integration with numpy arrays, so we can easily use scipy and scikit modules. We present a new method for point cloud classification, with two clustering methods and Fast Fourier Transform. The idea is based on that the elevation in the point cloud clusters has diferent frequency domain depending on thesurface; the buildings shows wider spectrum then the vegetation, and the ground has a very small spectrum. To make contiguous parts from the entire point cloud, we use DBSCAN clustering (Open3D), and BIRCH clustering(scikit-learn).</p>
      </abstract>
      <kwd-group>
        <kwd>Open3d</kwd>
        <kwd>LIDAR</kwd>
        <kwd>point cloud classification</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Algorithm</title>
      <sec id="sec-1-1">
        <title>1.1. Introduction</title>
        <p>
          The modern airborne laser scanners can save the waveform data for the points,
and captures more information from the scanned object ([
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]). This data determine
Copyright © 2020 for this paper by its authors. Use permitted under Creative Commons License
Attribution 4.0 International (CC BY 4.0).
what is the object (tree or building). In this case , we can use the point based
classifications. These classifications are simple and eficient; but if we have a point
cloud without reflectance values, we cannot use these ones.
        </p>
        <p>
          There are numerous algorithms, which can classify the point clouds with only
the , ,  coordinates ([
          <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
          ]). These algorithms are based on the decision of the
height above a calculated ground level, for example The BlueMarble Geo
classification (that examines the diference between the non ground points) and the Lastools
(that make contours from points of the same height).
        </p>
        <p>
          The third class of the algorithms is the machine learning based algorithm, such
as the well-known software CloudCompare’s plugin, the CANUPO ([
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]), that uses
SVM and LDA to classify the points. If you want to use these algorithms, you have
to train the classifier on a training set.
        </p>
      </sec>
      <sec id="sec-1-2">
        <title>1.2. The FFT based algorithm</title>
        <p>
          To overcome the issues mentioned above I developed an algorithm based on FFT
(Fast Fourier Transform). My classifier has six steps:
• DBSCAN clustering
• BIRCH clustering
• Compute the ground levels on a grid
• Defining the ground clusters
• Compute FFT on the non-ground clusters
• Classifying by the FFT values
Scikit ([
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]), the popular python library ofers 10 diferent general clustering method.
We can use the methods where do not need to specify the number of clusters, so
the K-means, Spectral, Ward algorithms are out of the box. During testing these
methods the Agglomerative and Meanshift were found inappropriate, because they
cannot handle great number of points. The fastest method was the DBSCAN ([
          <xref ref-type="bibr" rid="ref5 ref7">5,
7</xref>
          ]), and the BIRCH ([9]) worked well too. I have tried the Hierarchical DBSCAN
([
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]), the advanced version of the DBSCAN, but It have made too small clusters.
        </p>
        <p>Why the FFT? The FFT is a very fast algorithm, and in this case it’s practical
to use fast methods because of the huge number of points (for example I can use
an algorithm based on standard deviation of the normals on the mesh created from
the cluster points, but it’s too compute-intensive)</p>
        <sec id="sec-1-2-1">
          <title>1.2.1. DBSCAN clustering</title>
          <p>
            The DBSCAN algorithm considers clusters as areas of high density separated by
areas of low density. Due to this rather generic view, clusters found by DBSCAN
can be of any shapes, as opposed to k-means which assumes that clusters are
convex-shaped. It’s surprisingly fast and good, but clusters do not form continuous
surfaces. This algorithm has two input parameters, eps (distance value, two sample
minimum distance) and minimum samples (how many samples make new cluster).
On my point cloud sample I used eps=1.9 and minimum samples=30 - this settings
made the best result. (The 3D view generated by the Open3D visualiser ([
            <xref ref-type="bibr" rid="ref5">5</xref>
            ]))
          </p>
          <p>Assigning random colors to the generated clusters we can see there are clusters
with points belonging to buildings and vegetation; therefore these clusters have to
be divided into smaller ones if the clusters point density difer significantly from
the whole point cloud or it has too many points. So I need use another clustering
method based on nearest neighbour point distances. The used DBSCAN is an
Open3D built-in point cloud method, simple to use and fast. I made a test with
HDBSCAN (Hierarchical DBSCAN, az advanced version of the DBSCAN), but
this method formed two many small clusters.</p>
        </sec>
        <sec id="sec-1-2-2">
          <title>1.2.2. BIRCH clustering</title>
          <p>The Birch builds a tree called the Clustering Feature Tree (CFT) for the given data.
The Birch algorithm has two parameters, the threshold and the branching factor.
The branching factor limits the number of subclusters in a node and the threshold
limits the distance between the entering sample and the existing subclusters. This
method is not a suitable procedure for divide the whole point cloud, but it can cut
the big clusters after the DBSCAN. On my sample I used the following parameter
values: branching factor 50, nclusters None, threshold 3.9, compute labels True.</p>
          <p>This procedure is the part of the scipy.clustering.</p>
          <p>The disadvantage of these methods are that make too small clusters, and leave
non classified points. This problem leads to a failure in the FFT computing.</p>
        </sec>
        <sec id="sec-1-2-3">
          <title>1.2.3. Compute the ground levels on a grid</title>
          <p>Decisioning the ground level is simple: I segment the whole point cloud in an axis
oriented regular grid. The smallest Z value in a segment will the ground level, and
the x,y,z coordinate will be the minimum point.</p>
        </sec>
        <sec id="sec-1-2-4">
          <title>1.2.4. Defining the ground clusters</title>
          <p>I set the cluster to ground cluster when the diference between the closest minimum
point elevation (Z value) and the average elevation of the cluster’s points is less
then 0.4 meters, and the Z range of the cluster is less than 2 meters.</p>
        </sec>
        <sec id="sec-1-2-5">
          <title>1.2.5. Compute FFT on the non-ground clusters</title>
          <p>Computing FFT is a fast method, but it has a little handicap: this runs on
values are forming a regular grid. But the clusters made from the LIDAR point
cloud have points located randomly. Thus I have to generate a 100*100 regular
grid from the points using an interpolation method; this is a disadvantage of my
classifying algorithm, because this step requires lots of computation. I use the
scipy LinearNDInterpolator module to make the grid. This interpolation is based
on the Quickhull algorithm, and generates a Delaunay triangulation, and makes a
baricentric projection on the triangles to calculate the grid values.</p>
          <p>After the FFT transform in the frequency domain we can be see the frequency
components; the artifical objects show higher frequencies because the sharp edges,
the vegetation shows consistent spectrum. Figure 3. shows a cluster that contains
a part of a forest. The upper graph represents the points, the middle one shows the
interpolated grid, and the lower graph is the FFT image. The next sample on the
right shows a building; we can see that the clustering algorithm made a fault and
joined the tree to the building, but the FFT frequencies have a wider domain than
the forest. On the left there is a small cluster with few points; the interpolation
made a poorly evaluable result.</p>
          <p>(a) Pitched roof</p>
          <p>(b) Too small cluster</p>
        </sec>
        <sec id="sec-1-2-6">
          <title>1.2.6. Classifying by the FFT values</title>
          <p>During developing the earlier version of this algorithm I tried to compare the
computed FFT image with sample images (forest, flat roof, pitched roof). The standard
deviation of the two FFT that showed me the class of the cluster; but it has made
wrong results, because the scale and rotation of the sample and the examined
clusters had diferences.</p>
          <p>I found a working method: examining the width of the frequency domain. But
it has a problem, because if there is no enough points in the cluster, the FFT
generates lower frequency range. Because this I need to divide the range with the
number of the points, so I use five indicators: FFT variance/number of points; FFT
spectrum maximum and minimum; FFT standard deviation / number of points;
average of the FFT values; average elevation of the cluster’s points. On the non
classified cluster I calculate an elevation, and make it “ground” if this are bellow a
threshold value. Some clusters leave non classified (for example, the walls).</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Results and evaluating</title>
      <p>I ran the algorithm on two sample point clouds. These clouds have low resolution,
and contain metropolitain and town areas. There are trees mixed with family
houses, it is hard to recognize and separate, even for the human evaluator. The
ifgure on the left shows a smaller area, the right one represents a bigger one. The
green color is the vegetation, the blue color denotes the ground, and the red patches
represent buildings; the luminosity indicates the confidence of the classifying: dark
red is the “I’m absolutely sure”, the light red is the “hmm, maybe it’s a building”.
I used the same parameters on both samples. On the small sample, the classifier
(a) Classified small area
(b) Classified large area
made building from the trees, but on the bigger area the family houses changed to
forest. But it has good result in the recognizing of the flat roofed buildings, and
recognized the ground well.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Conclusion</title>
      <p>The popular clustering methods based on calculate the distances between the points
and searching the nearest neighbour. All of them use spatial indexing to accelerate
this searching, still it is a compute-intensive operation, and the execution time is
increasing logarithmically by the number of points. So, if we have large ares we
need to segment it, and run the clustering on the tiles. The DBSCAN clustering is
fast and simple to use, easy to set the parameters, but it has limited application.</p>
      <p>The Birch clustering makes mistakes and is slow, and has many parameters. It
is not a feasible algorithm for the point cloud operations.</p>
      <p>Finally I think these clustering methods -based only on the point
distancesare not too applicable for working with ALS point clouds. An efective clustering
method should consider the elevation of the point to make a cluster. Basically,
there is no really useful clustering method in this popular environment for the ALS
LIDAR files. Examining the FFT image can give satisfying result but based on a
suitable clustering method.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Marc</given-names>
            <surname>Bartels</surname>
          </string-name>
          , Hong
          <string-name>
            <surname>Wei</surname>
          </string-name>
          (
          <year>2009</year>
          )
          <article-title>Point-based classification http: //www</article-title>
          .cvg.reading.ac.uk/projects/LIDAR/publications/phd_reading/bartels_ wei_
          <article-title>LIDAR_ML_PRRS_06</article-title>
          .pdf
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>BlueMarble</given-names>
            <surname>Geo</surname>
          </string-name>
          <article-title>Global mapper nonground classification https://www</article-title>
          . bluemarblegeo.com/knowledgebase/global-mapper-19/Lidar_Module/nonground_ classification.htm
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>C.</given-names>
            <surname>Hug</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Krzystek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Fuchs</surname>
          </string-name>
          (
          <year>2004</year>
          )
          <article-title>Advanced lidar data processing with LasTools https://www</article-title>
          .researchgate.net/publication/228347125_Advanced_
          <article-title>lidar_data_processing_with_LasTools</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Nicolas</given-names>
            <surname>Brodu</surname>
          </string-name>
          (
          <year>2019</year>
          ) CANUPO classifier http://nicolas.brodu.net/common/ recherche/publications/canupo.pdf
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <article-title>[5] Open3D documentation www</article-title>
          .open3d.org
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>[6] Scipy clustering https://scikit-learn.org/stable/modules/clustering.html# dbscan</mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Martin</given-names>
            <surname>Ester</surname>
          </string-name>
          ,
          <string-name>
            <surname>Hans-Peter Kriegel</surname>
          </string-name>
          , Jiirg Sander, Xiaowei
          <string-name>
            <surname>Xu</surname>
          </string-name>
          (
          <year>1996</year>
          )
          <article-title>A Density-Based Algorithm for Discovering Clusters https</article-title>
          ://www.aaai.org/Papers/ KDD/1996/KDD96-037.pdf
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Ricardo J. G. B. CampelloDavoud MoulaviJoerg Sander</surname>
          </string-name>
          (
          <year>2013</year>
          )
          <article-title>DensityBased Clustering Based on Hierarchical Density Estimates https</article-title>
          ://link.springer. com/chapter/10.1007/978-3-
          <fpage>642</fpage>
          -37456-2_
          <fpage>14</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>