StrataQuest Home › StrataQuest Glossary › Canny Edge Detector
BOM Operation

Canny Edge Detector

Multi-stage edge detection producing thin, connected contours

View
Definition
The Canny edge detector finds edges in four documented steps. It computes the intensity gradients of the image, removes every pixel that is not the crest of its ridge (non-maximum suppression), applies a double threshold, and tracks edges by hysteresis: weak edge pixels survive only where they connect to strong ones. You set two numbers, Lower threshold and Upper threshold, and both start at 0.
Supporting
User Interface - Image Viewer + Toolbar
Video · Supporting
Four steps, in order
Gradient, thinning, double threshold, hysteresis
Non-maximum suppression
Thins each edge to its crest
Two thresholds, set by you
Both default to 0
Smooth first, if needed
Pair it with a Gauss filter

How It Works

Walk across the edge of a DAPI-stained nucleus and the brightness climbs over a few pixels. The gradient is large along that whole climb, so a plain thresholdLoading... on the gradient marks a band, not a line. Canny's steps turn the band into a line and determine which lines are real.

The Engines Reference lists the steps this way:

  1. Find the intensity gradients of the image.
  2. Apply non-maximum suppression to get rid of spurious responses.
  3. Apply a double threshold to determine potential edges.
  4. Track edges by hysteresis, suppressing the weak edges that are not connected to strong ones.

You'll find it in the FiltersLoading... list of the Basic Operations Module. The reference example takes an 8-bit grayscale DAPI image and returns an 8-bit grayscale image matching the input. The list starts at the gradient: it names no smoothing step, and the engine has no smoothing setting.

Two neighbors in Filters measure intensity change without the deciding steps. The Sobel filtersLoading... return a derivative along one axis or the diagonal, and the Laplace filterLoading... highlights rapid change in every direction; both return graded images that still need a threshold. The Membrane detectorLoading... is the specialist for thin lines, which are a double change of intensity. In general, a thin bright line has an edge on each side, so an edge detector reports it twice.

Simplified

Canny finds the places where brightness changes fastest, keeps only the single strongest pixel across each boundary, then applies two thresholds. Strong edges stay. Weak edges stay only if they touch a strong one. Isolated weak bits go.

Image Processing Foundation

In image processing generally, the detector comes from John Canny's 1986 paper, which set three goals: detect real edges and few false ones, place each edge where it truly is, and respond to each edge once. Non-maximum suppression serves the second and third goals. Hysteresis serves the first: a faint stretch of a real boundary survives because it is attached to a strong stretch, while an isolated faint response does not.

The textbook algorithm begins with a Gaussian blur whose width sets the scale of the edges found, then computes the gradient, often with Sobel kernels. StrataQuest's documented steps begin at the gradient, so the scale is chosen by whatever smoothing you place ahead of the detector, such as the Gauss filterLoading... and its Standard deviation. The reference doesn't say which gradient operator the engine uses.

Two thresholds are used rather than one because a single cut forces a choice between broken edges (set high) and speckle (set low). Hysteresis settles it with connectivity instead of brightness alone. Canny's own suggestion, which the reference repeats, is an upper-to-lower ratio of two or three to one, based on predicted signal-to-noise ratios.

Simplified

Canny set out three goals: find the real edges, put them in the right place, and report each one once. Thinning to the crest handles placement and the single response. The two thresholds handle detection, because faint parts of a real edge survive when they connect to strong parts.

Parameters & Settings

ParameterDefaultDescription
ImageThe input image. The reference example uses an 8-bit grayscale DAPI image.
Lower threshold0The lower threshold value for edge detection. Pixels between the two thresholds are kept only if connected to a strong edge.
Upper threshold0The upper threshold value for edge detection. Pixels above it are strong edges.

Both thresholds start at 0, so set them before trusting the output. One workable path: raise the Upper threshold until spurious edges in flat regions disappear, then set the Lower threshold to a half or a third of it, as Canny recommends. If real edges break into dashes, lower the Lower threshold; if grain still produces edges, smooth the input first.

Source: StrataQuest 8.1 Engines Reference, ch. 6.3 (Canny edge detector pp. 122–124; Gauss filter p. 129; Laplace filter p. 132; Membrane detector p. 138; Sobel filters pp. 144–151) and ch. 6 (p. 19).

Simplified

There are two numbers to set. The upper one sets what counts as a definite edge; the lower one sets how faint an edge may be and still count when it touches a definite one. Both start at 0, so you set them. Keep the upper about two or three times the lower.

Connected Terms

Share This Term
Term Connections