Edge Detection

With this application, users can create lineaments (line segments) from gridded data in a semi-automated fashion. The application uses machine vision algorithms from the Scikit-Image open-source package. Edges are exported to Geoscience ANALYST for viewing and editing.

_images/edge_detection_landing.png

New user? Visit the Getting Started page.

Application

The following sections provide details on the different parameters exposed in the user-interface (edge_detection.ui.json).

_images/edge_detection_ui.png

Data Selection

  • Object: Select the target Grid2D object from the dropdown list.

  • Data: Select the data attribute to use for edge detection.

Detection Parameters

List of parameters controlling the detection and filtering of lineaments.

  • Scikit-Image.feature.Canny
    • Sigma: Standard deviation of the Gaussian filter used to smooth the input data. Increase the parameter to detect fewer edges in noisy data.

  • Scikit-Image.transform.probabilistic_hough_line
    • Line length: Filter for the minimum length (pixels) of detected lines. Increase the parameter to extract longer lines.

    • Line gap: Maximum gap between pixels to still form a line. Increase the parameter to allow for longer edges over disconnected pixels.

    • Threshold: Threshold parameter used in the Hough Line Transform.

  • Optionals
    • Window size: Size of the square window used to sub-divide the grid for processing. By default, the window size is set to the shortest side of the input grid. Smaller window sizes can be used to speed up computations but may result in more fragmented lines. Larger window sizes can be used to improve line continuity but may slow down computations.

    • Merge length: Merge neighboring vertices generated by the Hough line transform, within a specified distance (in meters). This parameter is useful for merging fragmented lines that are close to each other but not connected.

Output Preferences

  • Save as: Assign a specific name to the resulting Curve object.

  • Group: Create a Container Group entity to store the results.

Methodology

The conversion from raster data to line segments involves the following four main processing steps.

_images/edge_detection_algo.png
  1. The selected gridded data are normalized between [0, 1]

  2. Normalized values are processed with the Canny detection algorithm to extract a binary edge map.

  3. The full grid is sub-divided into overlapping square tiles defined by the window size parameter. Tiling is used to speed up computations but to also avoid skewing the detection of lines along the longest axis of the input grid.

  4. For each tile, edges are converted to a line parametric form using the Hough Line Transform.

[Optional] The resulting vertices defining the segments can be filtered to reduce the number of unique lines. Collocated vertices are merged if they are within a specified distance of each other. This is controlled by the merge length parameter.

The final output is a Curve object containing the detected line segments. The orientation of the line segments, in absolute degree from North [-90, 90], and line length are stored as data on Curve.vertices.

Example

This section demonstrates the effect of various detection parameters on a training grid provided here. The goal is to extract the lineaments from gridded magnetic field data. We begin with default parameters and then explore the effect of changing each parameter independently.

Gridded magnetic data

Default parameters

_images/example_grid.png
_images/example_ui_default.png

Running the application with default parameters results in the following output.

Canny edges

Hough Lines

_images/example_canny_default.png
_images/example_result_default.png

Sigma

The following figure shows the effect of increasing the sigma parameter in the Canny edge detection algorithm. For sigma=3 we obtain:

Canny edges

Hough Lines

_images/example_canny_sigma3.png
_images/example_result_sigma3.png

Note that fewer small edges were recovered by the Canny algorithm, resulting in fewer lines in the final output.

Line Length

Next, we explore the effect of increasing the line length parameter in the Hough Line Transform.

With 12 pixels line length

With 24 pixels line length

_images/example_result_default.png
_images/example_result_line24.png

Note that shorter lines are filtered when increasing the line length parameter.

Line Gap

The following figure shows the effect of increasing the line gap parameter in the Hough Line Transform.

With 1 pixels line gap

With 4 pixels line gap

_images/example_result_default.png
_images/example_result_gap4.png

Note that increasing the line gap parameter results in increasing the number of detected lines.

Threshold

To demonstrate the effect of the threshold parameter, we will change the detection parameters to increase the number small segments.

_images/edge_detection_threshold.png

The table below presents the parameters and comparative results for threshold=1 and threshold=8.

With threshold=1

With threshold=8

_images/example_result_threshold1.png
_images/example_result_threshold8.png

Note that increasing the threshold parameter results in fewer output lines.

Merge Length

The following figure shows the effect of increasing the merge length parameter.

No merge

With 75 m merge length

_images/no_merge_length.png
_images/merge_length.png

Note that increasing the merge length parameter results in fewer output lines, and the segments are generally more continuous as more vertices are shared between lines.

Need help? Contact us at support@mirageoscience.com