The precondition for the Chainsaw-Algorithm to work is, that the given data is already sorted in a 2D tree. This can be easily achieved with the above mentioned KD-tree algorithm.
First the algorithm finds all neighbors around a defined center point. This point can be imagined as the center of a circle with a predefined diameter (patch size), where all points lying inside the circle belong to the same cell. Since we are working with a two dimensional tree the z-axis (height) of the points will be ignored. In the next step, we search the minimum of the z-axis from the located vertices. All points above a user given height, related to the minimum, will be deleted. Now move the center of the circle to the center of the next cell and continue.
The steps of the Chainsaw Algorithm:
Search all points P inside a circle (cell)
Identify the minimum M of the z-coordinate (height) of P
Delete all points above a user given threshold T related to M
Go to the next cell, until all cells are examined
Limits of the Chainsaw Algorithm
The Chainsaw Algorithm is only capable of a raw recognition of the ground surface. Bushes beyond
the threshold wont be deleted whereas objects like walls and gravestones above the value will be radically cut. The user has to choose the cut-off threshold carefully to get a pleasant result. One may prefer a complete automatic process to remove plants from 3D scans.