I’ve written a package for image processing in R, with the goal of providing a fast API in R that lets you do things in C++ if you need to. The package is called imager, and it’ on Github.
The whole thing is based on CImg, a very nice C++ library for image processing by David Tschumperlé.
- Handles images in up to 4 dimensions, meaning you can use it for volumetric/hyperspectral/data or short videos
- Facilities for taking subsets of images, pixel neighbourhoods, etc.
- All the usual image processing stuff (filters, morphology, transformations, interpolation, etc.)
- Easy access to the C++ API via Rcpp
The package is still in an early phase but it can already do a lot of useful things as you’ll see from the documentation.
library(imager) im <- load.image(system.file('extdata/parrots.png',package='imager')) layout(t(1:3)) plot(im,main="Original image") grad <- grayscale(im) %>% get_gradient("xy") names(grad) <- paste("Gradient along",c("x","y")) l_ply(names(grad),function(n) plot(grad[[n]],main=n))
Visit the website for more information.