Expand description
Canny edge detection.
The Canny detector turns an image into thin, connected, one-pixel-wide edges in four stages:
- Smooth with a Gaussian (scale
sigma) to suppress noise that would create false edges. - Differentiate with the Sobel operator to get gradient magnitude and direction.
- 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.
- Link by hysteresis thresholding: pixels above the
highthreshold are certain edges; pixels betweenlowandhighare 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 scalesigma(pixels), and hysteresis thresholdslow <= highon the gradient magnitude. Returns a boolean edge map.