This repository contains code to automatically extract solitary trees and tree-clusters from aerial point clouds of the Actueel Hoogtebestand Nederland (AHN4), an openly available elevation model of the Netherlands obtained by aerial laser scanning. The point cloud tiles can be downloaded from geotiles.nl.
The pipeline consists of six steps (see the notebooks
):
- Pre-processing the raw AHN data by generating subtiles of manageable size and computing the DTM.
- Extracting trees by using existing labels in the AHN4 data, combined with filters based on point attributes such as normals, reflectance, and return number.
- Generating GeoTIFF rasters of the results.
- Generating polygons of the found trees and tree-clusters using the alpha shape method to compute concave hulls.
- Extracting individual tree trunks from the extracted trees.
- Analyzing the predictions of the tree trunks by comparing against ground thruth data.
Example:
Raw AHN4 point cloud | Extracted trees |
Tree shapes | Tree trunks | Analysis |
data
Sample datamedia/examples
Visualsnotebooks
Jupyter notebook tutorialssrc/gvl
Python helper functions
-
Clone this repository:
git clone https://github.com/Amsterdam-AI-Team/Tree_Detection_in_Aerial_Point_Clouds.git
-
Create the environment
ahn-tree
and install the dependencies:conda env create -f environment.yml conda activate ahn-tree
-
Finally, install
cccorelib
andpycc
into theahn-tree
environment by following the instructions on their GitHub page. Please note, these two packages are not available on the Python Package Index (PyPi).Note: installing these packages is known to cause issues. For help and questions please consult the issue list on the original repository.
-
Check out the notebooks for a demonstration.
We provide tutorial notebooks that demonstrate how the code can be used. This repository was designed to be used with the specific data source: AHN. AHN4 point clouds can be downloaded from ArcGIS or GeoTiles.
We tested the pipeline on ground truth data of 600+ trees in several neighbourhoods in the Southeast and East of Amsterdam. Here, the detection and localization of individual tree trunks worked relatively well for solitary trees (recall of ~0.8) and not so well for dense clusters of trees (recall of 0.3-0.7). Overall precision was around 0.6.
Feel free to help out! Open an issue, submit a PR or contact us.
This repository was created by Amsterdam Intelligence for the City of Amsterdam.
This project is licensed under the terms of the European Union Public License 1.2 (EUPL-1.2).