[This article was first published on dahtah » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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é.
Features:
- 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.
Example code:
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.
To leave a comment for the author, please follow the link and comment on their blog: dahtah » R.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.