canny
finds edges in an image using the Canny algorithm.
canny(
image,
threshold1,
threshold2,
aperture_size = 3,
L2_gradient = FALSE,
target = "new"
)
An Image
object.
A numeric indicating the first threshold for the hysteresis procedure
A numeric indicating the second threshold for the hysteresis procedure
Aperture size for the Sobel operator (default: 3).
A logical flag, indicating whether a more accurate L2 norm should be used to calculate the image gradient magnitude, or whether the default L1 norm is enough (default: FALSE).
The location where the results should be stored. It can take 3 values:
If target="new"
, the function returns an Image
object. If target
is an Image
object, the function
returns nothing and modifies that Image
object in place.
Canny J. A computational approach to edge detection. IEEE Trans Pattern Anal Mach Intell. 1986;8: 679<U+2013>698. doi:10.1109/TPAMI.1986.4767851
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) balloon_canny <- canny(balloon, 50, 50)