Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image analysis in R

I would like to know how I would go about performing image analysis in R. My goal is to convert images into matrices (pixel-wise information), extract/quantify color, estimate the presence of shapes and compare images based on such metrics/patterns.

I am aware of relevant packages available in Python (suggestions relevant to Python are also welcome), but I am looking to accomplish these tasks in R.

Thank you for your feedback.

-Harsh

like image 728
harshsinghal Avatar asked Oct 17 '10 20:10

harshsinghal


People also ask

Can R be used for image processing?

R brings interesting statistical and graphical tools which are important and necessary for image processing techniques. Furthermore, it has been proved in the literature that R is among the most reliable, accurate and portable statistical software available.

What is image analysis technique?

Image analysis involves processing an image into fundamental components to extract meaningful information. Image analysis can include tasks such as finding shapes, detecting edges, removing noise, counting objects, and calculating statistics for texture analysis or image quality.

What is image analysis in remote sensing?

Remote Sensing image analysis is mostly done using only spectral information on a pixel by pixel basis. Information captured in neighbouring cells, or information about patterns surrounding the pixel of interest often provides useful supplementary information.


2 Answers

I'd start with EBImage - check out the vignette which demonstrates many of the tasks you mention.

like image 91
hadley Avatar answered Sep 22 '22 20:09

hadley


Also check out the RASTER package on the R-Forge website:

http://r-forge.r-project.org/projects/raster/

It is not released to CRAN yet but it is an excellent package to import, analyse, extract, subset images and convert them to matrices). Spatial analysis is also possible.

You can download the package in R via:

install.packages("raster",repos="http://r-forge.r-project.org")
require(raster)

An example for R:

#from file
r <- raster(system.file("external/test.grd", package="raster"))
logo <- raster(system.file("external/rlogo.grd", package="raster"), values=TRUE) 
plot(logo)

Check out

?raster # and go to index of the package for an overview of all the options for image analysis.
like image 29
Janvb Avatar answered Sep 23 '22 20:09

Janvb