Skip to main content

Module canny_edge_detection

Module canny_edge_detection 

Source
Expand description

Canny edge detection.

The Canny detector turns an image into thin, connected, one-pixel-wide edges in four stages:

  1. Smooth with a Gaussian (scale sigma) to suppress noise that would create false edges.
  2. Differentiate with the Sobel operator to get gradient magnitude and direction.
  3. Thin by non-maximum suppression: keep a pixel only if its magnitude is at least as large as both neighbours along the gradient direction, i.e. it is on the ridge of the edge.
  4. Link by hysteresis thresholding: pixels above the high threshold are certain edges; pixels between low and high are kept only if they connect (8-neighbourhood) to a certain edge. This keeps faint parts of real edges while discarding isolated noise.

Thresholds are on the gradient magnitude in intensity units per pixel. The outermost pixel border is never marked.

See the book entry Segmentation.

Functionsยง

canny_edge_detection
Detects edges in image: smoothing scale sigma (pixels), and hysteresis thresholds low <= high on the gradient magnitude. Returns a boolean edge map.