Identifies open terrain parts of a DSM input raster using the volume based approach by Piltz et al. (2016).
The basic input for Module TerrainMask is a DSM raster (inFile) in GDAL (GeoData Abstraction Library) readable format. The resulting mask (outFile) is stored as a binary raster file again in a GDAL supported format. A pixel value of 0 hereby denotes (open) terrain areas and 1 off-terrain objects (vegetation, buildings, power lines, etc.). The volume based filtering apporoach is controlled by two parameters: (i) the minimum height (minHeight) necessary to classify elevated objects as off-terrain and (ii) the maximum width (maxWidth) denoting the admissable size of such an elevated object (i.e. maximum building length/width). The algorithm processes the input DSM in axis parallel and diagonal profiles (N-S, E-W, NW-SE, SW-NE) and runs the classification separately for all four directions. A simple voting scheme combining the results of all four directional masks is applied to obtain the final terrain mask. The parameter (minConsensus) hereby denotes the minimum number of (directional) masks classifying a certain pixel as elevated. If debugOutFile is activated the four directional masks are additionally saved to disk allowing arbitrary post-processing.
The basic off-terrain classification strategy is demonstrated for a single profile in Figure 1.
For a certain location x within the scanline and a certain width w the normalized volume above ground is calculated as the sum of "pixel elevation minus reference elevation minus minimum object height (nvag)". The reference height is defined as the higher elevation of the pixels neighboring the start and the end location (x-1 and x+w, respectively). If nvag is greater than zero the respective profile range (w) is a potential off-terrain candidate. The optimum (non overlapping) set of x/w combinations is found by solving a longest path problem in a graph where each x is a vertex and each x,w pair an edge between x and x+w with a weight of nvag(x,w). For more details please refer to the cited literature.
The data used in the following examples can be found in the $OPALS_ROOT/demo/
directory. Please use the following commands to generate a DSM.
The following command extracts the DTM mask considering a minimum object height of 3m and maximum object width of 60m.
The resulting DTM mask is shown in Figure 1.
Running the command
prints the usage screen.
Piltz, B., Bayer, S., and Poznanska, A. M.: Volume based DTM generation from very high resolution photogrammetric DSMs, Int. Arch. Photogramm. Remote Sens. Spatial Inf. Sci., XLI-B3, 83-90, doi:10.5194/isprs-archives-XLI-B3-83-2016, 2016.