image_detect_corners {image.CornerDetectionF9} | R Documentation |
An implementation of the "FAST-9" corner detection algorithm explained at <http://www.edwardrosten.com/work/fast.html>.
image_detect_corners(x, threshold = 50L, suppress_non_max = FALSE)
x |
a matrix of image pixel values in the 0-255 range. |
threshold |
positive integer where threshold is the threshold below which differences in luminosity between adjacent pixels are ignored. Think of it as a smoothing parameter. |
suppress_non_max |
logical |
as list of the found corners with the x/y locations
library(pixmap) imagelocation <- system.file("extdata", "chairs.pgm", package="image.CornerDetectionF9") image <- read.pnm(file = imagelocation, cellres = 1) x <- image@grey * 255 corners <- image_detect_corners(x, 80) plot(image) points(corners$x, corners$y, col = "red", pch = 20, lwd = 0.5) ## ## image_detect_corners expects a matrix as input ## if you have a jpg/png/... convert it to pgm first or take the r/g/b channel f <- tempfile(fileext = ".pgm") library(magick) x <- image_read(system.file("extdata", "hall.jpg", package="image.CornerDetectionF9")) x <- image_convert(x, format = "pgm", depth = 8) image_write(x, path = f, format = "pgm") image <- read.pnm(f, cellres = 1) corners <- image_detect_corners(image@grey * 255, 80) plot(image) points(corners$x, corners$y, col = "red", pch = 20, lwd = 0.5)