Aim of module

General description

The aim of opalsEdgeDetect is to provide an interface for different edge detectors. Based on an input raster file and an appropriate set of parameters for the respective edge detection algorithm, a binary output raster is derived containing the detected edge pixels.

Canny algorithm

A comprehensive description of the Canny edge detection can be found here. In a nutshell, the Canny algorithm consists of the following steps:

Calculation of gradient in two orthogonal directions (based on the first derivative of Gaussian operator, Gx and Gy).

Non-maximum suppression (resulting in 1-pixel-edge lines)

Application of upper and lower threshold.

Edge tracking by hysteresis. Starting with pixels exhibiting gradients > upper threshold, the edges are extended (in both directions) until the gradient falls below the lower threshold. Finally, weak edges which are not connected to strong edges, are removed.

Implementation details

Please note, that while the Canny algorithm is a generic edge detector, the main application in the context of OPALS is to detect topographic breaklines (i.e. surface slope disontinuities like dams, ridges, ditches, embankments...). In this special case, a slope raster (pixel value = surface gradient in degree) turned out to be the best choice (c.f. Mandlburger et al., 2016).

Parameter description

Type: opals::Path
Remarks: estimable
Path of (binary) raster image file in GDAL supported format containing edge pixels.
Estimation rule: The current directory and the name (body) of the input file are used as file name basis. Additionally, the postfix '_edge' and the output format extension are appended (e.g. '_edge.tif').

-oFormatraster file format [GTiff,EHdr...]

Type: opals::String
Remarks: estimable
Use GDAL driver names like GTiff, EHdr... . It is recommended to use output formats supporting a binary (0|1) data type.
Estimation rule: The output format is estimated based on the extension of the output file (*.tif->GTiff, *.bil->EHdr, *.dtm->SCOP...).

Please note, that currently only the Canny edge detection is implemented.

-sigmaSmoothgaussian smoothing sigma

Type: float
Remarks: default=1
The standard deviation of the gaussian function for smoothing gradient computation using first-derivative of gaussian function. the value should be a positive number larger than 0.25.The kernel radius is three times parameter's value.

-thresholdthreshold values

Type: opals::Array<double,2>
Remarks: default=2 10
Depending on the edge detection methods, different threshold values are required. Canny: upper/lower threshold. The upper threshold denotes the minimum gradient necessary to start an edge. Starting from such an feature pixel the edge is extended in both directions until the gradient falls below the lower threshold.

Type: opals::GridLimit
Remarks: optional
If no user defined limits are specified or -limit is even skipped, the entire xy-extents of the input raster model are used.

Examples

The data used in the following examples can be found in the $OPALS_ROOT/demo/ directory. As a prerequisite, please use the following commands to generate a DTM from the ALS ground points stored in dataset flyover.laz.

Now we can use Module EdgeDetect to detect the approximate 2D course of break lines from the resulting DTM slope raster. We specify the input grid (slope raster), the resulting binary raster image file containing the edge pixels, the kernel radius for gaussian smoothing, and the lower and upper threshold.