Skip to contents

Canny Edge Detector for Images. Adapted from https://github.com/bnosac/image/tree/master/image.CannyEdges.

Usage

image_canny_edge(img, index = "GRAY", s = 5, low_thr = 10, high_thr = 20)

Arguments

img

An Image object.

index

A character string with the index to be used. Defaults to "GRAY".

s

sigma, the Gaussian filter variance. Defaults to 5.

low_thr

lower threshold value of the algorithm. Defaults to 10.

high_thr

upper threshold value of the algorithm. Defaults to 20

Value

a list with an Image object with values 0 or 255, and the number of pixels which have value 255 (pixels_nonzero).

Examples

if(interactive()){
library(pliman)
img <- image_pliman("sev_leaf.jpg")
conts <- image_canny_edge(img, index = "B")
par(mfrow = c(1, 2))
plot(img)
plot(conts$edges)
par(mfrow = c(1, 1))
}