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
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.
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.
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.
I'd start with EBImage
- check out the vignette which demonstrates many of the tasks you mention.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With