Package: fastgac
Fast Gaussian AccumulatorA Gaussian Sphere Accumulator refers to the notion of discretizing thesurfaceof the unit sphere (a gaussian surface) into buckets/cells. One can then integrate/accumulate a list ofpoints(aka unit normals) into these buckets.
The end result is then a histogram of the sphere. There are many choices for the discretization process, however this library uses equilateral triangles because each cell will have nearly the sameareaandshape. This process is done byrefiningan icosahedron. The following image shows our discretization strategy. The first object discretizes a sphere with uniform spacing of phi/theta (note small cells at poles), the second object is an icosahedron, the third object is the first level of refinement for an icosahedron, the last object is the second level of refinement of an icosahedron.Once a level of refinement is chosen, one can then integrate point vectors into the cells/buckets. For example integrating the normals of a level four (4) icosahedron would look like the image below. Bright yellow indicates more counts for the triangle cells. This is basically showing that the floor [0, 0, 1] and walls [0, +/-1, 0] are common.Finding the CellTo do this one mustfindthe cell that corresponds to the point. This is a search process that has been implemented in several fashions in this repo. The main ways are as follows:3D KD Tree - Do a nearest neighbor search using a binary tree.GaussianAccumulatorKDPY- One implementation using scipy kdtree.GaussianAccumulatorKDOne implementation uses C++ nanoflann.Global Index and Local Search - A 3D point is transformed to a unique integer id. The unique ids have the property that ids close to each other will be close to each other in 3D space. The closest id is found corresponding to a triangle cell. A local search of triangle neighbors is performed to find closest triangle cell to the point.GaussianAccumulatorOpt- Works good ononlyon the top hemisphere. Projects 3D point to plane using Azimuth Equal Area projection. Convert 2D point to int32 index using Hilbert Curve. This implementation is severely limited and is not recommended.GaussianAccumulatorS2Beta- Works on full sphere! Uses Googles S2 space filling curve (uint64). 3D point is projected to unit cube, assigned to a face of the cube, and then a Hilbert curve index is found for that cube face. This is recommended, and what I use.Use GaussianAccumulatorS2Beta! Look atpython -m examples.python.run_normalsPeak DetectionThere are two (2) peak detection methods of used within this repository. The user can choose which one best suite there needs.2D Image Peak DetectionThis method basically unwraps the icosahedron as a 2D image in a very particular way as described byGauge Equivariant Convolutional Networks and the Icosahedral CNN. This unwrapping is hardcoded and fixed once a refinement level is chosen so its very fast. The library then uses a 2D peak detector algorithm followed up with agglomerative hierarchial clustering (AHC) to group similar peaks. All of this is user configurable.1D Signal Peak DetectionThis performs peak detection on the 1D thread following the hilbert curve. This produces more peaks which are actually near each other on S2 and are then grouped with AHC. This actually works pretty well, but I recommend to use the 2D Image Peak Detector.InstallationFor python there are pre-built binary wheel on PyPI for Windows and Linux. You can install withpip install fastgac.Below are instruction to build the C++ Package (and python package) manaully with CMake. Installation is entirely through CMake now. You must have CMake 3.14 or higher installed and a C++ compiler with C++ 14 or higher.Build Project Librarymkdir cmake-build && cd cmake-build. - create build folder directorycmake ../ -DCMAKE_BUILD_TYPE=Release. For windows also add-DCMAKE_GENERATOR_PLATFORM=x64cmake --build . -j$(nproc) --config Release- Build FastGABuild and Install Python ExtensionFor DevelopersInstallcondaor create a python virtual environment (Why?). I recommend conda for Windows users.cd cmake-build && cmake --build . --target python-package --config Release -j$(nproc)cd lib/python_package &&  pip install -e .If you want to run the examples then you need to install the following (from main directory):pip install -r dev-requirements.txtFor Python Users (Requires CMake)Installcondaor create a python virtual environment (Why?). I recommend conda for Windows users.pip install .If you want to run the examples then you need to install the following (from main directory):pip install -r dev-requirements.txtDocumentationPlease seedocumentation websitefor more details.CitationTo support our work please cite:@Article{s20174819,
AUTHOR = {Castagno, Jeremy and Atkins, Ella},
TITLE = {Polylidar3D-Fast Polygon Extraction from 3D Data},
JOURNAL = {Sensors},
VOLUME = {20},
YEAR = {2020},
NUMBER = {17},
ARTICLE-NUMBER = {4819},
URL = {https://www.mdpi.com/1424-8220/20/17/4819},
ISSN = {1424-8220}
}