[R] Images Import and Analysis

Henrik Bengtsson hb at maths.lth.se
Fri May 16 16:05:53 CEST 2003

Package 'pixmap' [ install.packages("pixmap") ] has support for "import,
export, plotting and other manipulations of bitmapped images". More
precisely, you can read and write Portable Anymap Images, i.e. ppm
(rgb), pgm (gray), pbm (monochrome). For tiff, png, jpg etc you first
have to convert your images to the above formats before importing them
into R. ImageMagick's (http://www.imagemagick.org/) command line
'convert' command available for many platforms is good for this. With
the right path settings, you can basically do this from within R by
using system(), e.g.

  system("convert foo.jpg foo.ppm")
  img <- read.pnm("foo.ppm")

However, 'pixmap' do not contain much image analysis functions so those
you have to write yourself.

Henrik Bengtsson
Lund University

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Shawn Way
> Sent: den 16 maj 2003 14:20
> To: r-help at stat.math.ethz.ch
> Subject: [R] Images Import and Analysis
> I'm starting a time study on an area.  To determine if an 
> individual has entered the area, we are having timed 
> photographs taken of the area.  What I want to do is import 
> the image files (either one at a time or simultaneously), 
> convert it to a density image, take the density at multiple 
> points in the image and determine if they are over an area 
> average (indicating someone or something is in that area).
> Any ideas on how to get started (importing the images) in R? 
> (programming tool of choice)
> Shawn Way
> Engineering Manager
> Tanox, Inc.
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo> /r-help

More information about the R-help mailing list