New package for image processing in R

June 5, 2015
By

(This article was first published on dahtah » R, and kindly contributed to R-bloggers)

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))

example_parrots

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 on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)