Skip to content

Instantly share code, notes, and snippets.

@hobu
Created December 20, 2016 19:52
Show Gist options
  • Save hobu/aca5d6818164f4080baeea39bd2b5005 to your computer and use it in GitHub Desktop.
Save hobu/aca5d6818164f4080baeea39bd2b5005 to your computer and use it in GitHub Desktop.
Notes
-------------------------------------------------------------------------------
* ``slope`` controls the height threshold at each iteration. A slope of ``1.0``
represents a 1:1 or 45º.
* ``initial_distance`` is _intended_ to be set to account for z noise, so for a
flat surface if you have an uncertainty of around 15 cm, you set
``initial_distance`` large enough to not exclude these points from the ground.
* Ideally, the window size of the morphological operation should be small
enough to preserve all ground details and large enough to remove buildings,
cars, and trees. Unfortunately, an ideal window size does not exist in the
real world.
* For a given iteration, the height threshold is determined by multiplying
``slope`` by ``cell_size`` by the difference in window size between the current
and last iteration, plus the ``initial_distance``. This height threshold is
constant across all cells and is maxed out at the ``max_distance`` value. If
the difference in elevation between a point and its “opened” value (from the
morphological operator) exceeds the height threshold, it is treated as
non-ground. So, bigger slope leads to bigger height thresholds, and these
grow with each iteration (not to exceed the max). With flat terrain,
keep this low, the thresholds are small, and stuff is more aggressively
dumped into non-ground class. In rugged terrain, open things up
a little, but then you can start missing buildings, veg, etc.
* Very large ``max_window_size`` values will result in a lot of potentially
extra iteration. This parameter can have a strongly negative impact on
computation performance.
@chambbj
Copy link

chambbj commented Dec 20, 2016

Partial quotes from the authors that could be cited/reworded as recommendations for our docs...

The elevation difference threshold can be determined based on the slope of topography in the study area. There is a relationship between the maximum elevation difference for the terrain, window size, and the terrain slope assuming that the slope is constant.

In urban areas, primary nonground objects include cars, trees, and buildings. The sizes of individual cars and trees are much less than that of the buildings, so most of them are often removed in the first several iterations, while the large buildings will be removed last. The maximum elevation difference threshold can be set to a fixed height (e.g., the lowest building height) to ensure that building complexes are identified. The optimum is usually achieved by iteratively comparing the filtered and unfiltered data. On the other hand, the nonground objects in the mountainous areas are primarily vegetation (trees). There is no need to set up a fixed maximum elevation difference threshold to remove trees, and is usually set up as the largest elevation difference in the study area.

The initial distance is set to be approximately equal to the LIDAR measurement error.

The cell size was set to ... about two times less than the average spacing between LIDAR measurements...

A small slope factor (0.08) was selected to filter this urban dataset with nearly flat terrain. A 2.5-m maximum elevation difference threshold was used to ensure the removal of the buildings.

For the high-relief test area, ... a maximum elevation difference threshold was set to be the largest elevation difference value in the analyzed area. The terrain slopes are set to be close to the maximum slope.

LIDAR data sometimes may contain a few points with large negative elevation values drastically lower than those of their neighbors. These measurements are called negative blunders... The proposed progressive morphological filter cannot remove negative blunders by only performing the opening operation. When a DTM is interpolated using the ground measurements including negative blunders, conical pits like “bomb craters” will be generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment