Edge Detection

class droppy.edgedetection.CannyPlugin(*args, **kwargs)

Modification of Canny Plugin provided by Scikit-image to return parameter values

Uses the default values of:

  • sigma == 0 (No Gaussian blurring)

  • high == 1 (strong pixels are all the way on)

  • low == 1 (weak pixels are all the way on)

add_widget(widget)

Add the new Canny filter widget ot the plugin while registering a new callback method to set the widgets attributes so they can be accessed later.

attach(image_viewer)

Override the attaching of the plugin to the ImageViewer. This utilizes nearly identical implementation to https://github.com/scikit-image/ scikit-image/blob/master/skimage/viewer/plugins/canny.py, but changes the limits for parameter selection.

output()

Override the default output behavior so that when the ImageViewer is closed, the result contains parameter values that we need to pass on to all future edge detection calls.

droppy.edgedetection.extract_edges(image, σ=1, low=None, high=None, indices=True)

Compute the detected edges using the canny algorithm

Parameters
  • image – numpy grayscale image

  • σ – canny filter value to use

  • check_σ – flag whether to visually check the edges that are detected

Returns

list of [x,y] coordinates for the detected edges

droppy.edgedetection.sigma_setter(image, σ=1, bounds=None)

Show the user the image with the detected edges overlain in a way that they can update the edge detection parameters and see the impact on the edges.

Parameters
  • image – 2D numpy grayscale image

  • σ – Standard deviation value for the Gaussian blur applied before edge detection

  • bounds – List of [left, right, top, bottom] crop for the image area