Implementation of the Unsupervised Smooth Contour Line Detection for Images

An implementation of the Unsupervised Smooth Contour Detection algorithm for digital images as described in the paper: "Unsupervised Smooth Contour Detection" by Rafael Grompone von Gioi, and Gregory Randall (2016). The algorithm is explained at .


image.ContourDetector - Unsupervised Smooth Contour Line Detection for images

The image.ContourDetector R package implements Unsupervised Smooth Contour Line Detection for images.

  • It contains 1 main function image_contour_detector. If you give it an image matrix with grey scale values in the 0-255 range, it will find contour lines in the image.
  • The algorithm is defined in Rafael Grompone von Gioi, and Gregory Randall, Unsupervised Smooth Contour Detection, Image Processing On Line, 6 (2016), pp. 233-267. https://doi.org/10.5201/ipol.2016.175
  • Mark that if you are looking in detecting lines, you might also be interested in https://github.com/bnosac/image/image.LineSegmentDetector

Examples

Read in an image with values in the 0-255 range (pgm image: http://netpbm.sourceforge.net/doc/pgm.html)

library(image.ContourDetector)
library(pixmap)
imagelocation <- system.file("extdata", "image.pgm", package="image.ContourDetector")
image <- read.pnm(file = imagelocation, cellres = 1)
x     <- image@grey * 255
contourlines <- image_contour_detector(x)
contourlines
plot(image)
plot(contourlines)

If you have another type of image (jpg, png, ...). Convert the image to portable grey format before applying the function

library(magick)
x   <- image_read(system.file("extdata", "atomium.jpg", package="image.ContourDetector"))
mat <- image_data(x, channels = "gray")
mat <- as.integer(mat, transpose = TRUE)
mat <- drop(mat)
contourlines <- image_contour_detector(mat)
plot(contourlines)

plt <- image_draw(x)
contourlines$data$y <- image_info(x)$height - contourlines$data$y
plot(contourlines, add = TRUE, col = "red", lwd = 3)
dev.off()

Support in image recognition

Need support in image recognition? Contact BNOSAC: http://www.bnosac.be

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("image.ContourDetector")

0.1.2 by Jan Wijffels, a year ago


https://github.com/bnosac/image


Browse source code at https://github.com/cran/image.ContourDetector


Authors: Jan Wijffels [aut, cre, cph] (R wrapper) , BNOSAC [cph] (R wrapper) , Rafael Grompone von Gioi [ctb, cph] (src/smooth_contours) , Gregory Randall [ctb, cph] (src/smooth_contours) , Niccolò Marchi [ctb]


Documentation:   PDF Manual  


AGPL-3 license


Imports Rcpp, sp

Suggests pixmap, magick, raster

Linking to Rcpp


See at CRAN