Table of Contents
- See Also
- opals::IEdgeDetect
Aim of module
Provides different raster based edge detection algorithms (e.g. Canny).
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.
- See Also
- Module EdgeDetect
Module EdgeDetect is implemented using the OPALS modules Convolution and Algebra. Please note, that currently only Canny edge detection is implemented.
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
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').
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...).
Remarks: default=Canny
Possible values: Canny ... Canny Edge Detector
Please note, that currently only the Canny edge detection is implemented.
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.
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.
Remarks: estimable
Directory path for storing intermediate files (gradient and exposition images, etc.).
Estimation rule: Current working directory + '/tempEdgeDetect'
Remarks: default=0
If activated, all intermediate products (gradient and exposition images, etc.) are preserved. Otherwise, the entire temporary directory (-tempDirectory) is deleted at program termination.
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.
effects of smoothing on the edge detection result
References
-
Canny, J., A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8(6):679–698, 1986.
- G. Mandlburger, J. Otepka, C. Briese, W. Mücke, G. Summer, N. Pfeifer, S. Baltrusch, C. Dorn, H. Brockmann: Automatische Ableitung von Strukturlinien aus 3D-Punktwolken. in: Publikationen der Deutschen Gesellschaft für Photogrammetrie, Fernerkundung und Geoinformation e.V., Band 25 (2016), ISSN: 0942-2870; 131 - 142.
- Date
- 8.1.2017
