curve_apps.edges package

Submodules

curve_apps.edges.driver module

class curve_apps.edges.driver.EdgesDriver(*args: Any, **kwargs: Any)

Bases: BaseCurveDriver

Driver for the edge detection application.

Parameters:

parameters – Application parameters.

static get_canny_edges(grid: geoh5py.objects.Grid2D, data: geoh5py.data.FloatData, detection: EdgeDetectionParameters) numpy.ndarray

Get edges from a grid.

Parameters:
  • grid – Grid2D object.

  • data – FloatData object.

  • detection – Detection parameters.

Returns:

Edges from Canny transform.

static get_edges(grid: geoh5py.objects.Grid2D, edges: numpy.ndarray, detection: EdgeDetectionParameters) tuple[numpy.ndarray, numpy.ndarray] | tuple[None, None]

Find edges in gridded data.

Params grid:

A Grid2D object.

Params edges:

Edges representation of the grid from Canny transform.

Params detection:

Detection parameters.

:returns : n x 3 array. Vertices of edges. :returns : n x 2 float array. Cells of edges.

static get_line_indices(canny_image: numpy.ndarray, line_length: int = 1, line_gap: int = 1, threshold: int = 1, window_size: int | None = None) list

Get indices forming lines on a canny image.

The process is done over tiles of square size. The tiles overlap by 25%.

Parameters:
  • canny_image – Edges.

  • line_length – Minimum accepted pixel length of detected lines. (Hough)

  • line_gap – Maximum gap between pixels to still form a line. (Hough)

  • threshold – Value threshold. (Hough)

  • window_size – Size of the window to search for lines.

Returns:

List of indices.

make_curve()

Make curve object from edges detected in source data.

The application relies on the Canny and Hough transforms from the Scikit-Image library.

curve_apps.edges.params module