edge_canny: Apply the Canny edge detection

View source: R/pictplot.R

edge_cannyR Documentation

Apply the Canny edge detection

Description

This is the wrapper of the cannyEdges() function in the imager package. t1 and t2 determines the edge threshold. if the threshold parameters are missing, they are determined automatically using a k-means heuristic. alpha parameter adjusts the automatic thresholds up or down. The edge detection is based on a smoothed image gradient (set by the sigma parameter). If smoothing parameter is set, high frequency noise is removed before applying the Canny edge detection.

Usage

edge_canny(im, t1, t2, alpha = 1, sigma = 2, smoothing = 0)

Arguments

im

an image.

t1

threshold for weak edges (if missing, both thresholds are determined automatically).

t2

threshold for strong edges.

alpha

threshold adjustment factor (default 1).

sigma

degree of smoothing image gradient.

smoothing

numeric (integer). Smoothness of image texture.

Value

an array of the edge image.

Examples

im = edge_canny(regatta)
plot(im)

tsuda16k/pictplot documentation built on March 1, 2023, 8:44 p.m.