[R] image processing and plotting at video rates ?

Philipp Fechteler philipp.fechteler at hhi.fraunhofer.de
Fri Apr 11 23:55:04 CEST 2008

Hello R user

I am using R now for some time and I like it a lot. I just started a new 
project where I am working with video streams at a resolution of 1024 x 
768 pixels. I am reading the images out of a big raw file containing the 
uncompressed data. I do this via "readBin".

As far as I have found out R has no build in support for image data to 
plot. Looking at CRAN has brought up "biOps" with many basic features 
for image processing as well as plotting. But the plotting speed quite 
bad (for video). By just reading the image data out of the file and 
plotting the image, without any further processing, I have frame rates 
less then a single frame per second on a 2,4 GHz dual-core Pentium.

Here is the code I am using

for (i in 1:500)
   img <- imagedata( array(numCols, numRows, 3),
       type="rgb", ncol=numCols, nrow=numRows)
   tmp <- readBin(inFD, integer(), numCols * numRows * 4, 1, FALSE)
   img[,,] <- matrix(tmp, ncol=4, byrow=TRUE)[,1:3] #leaving out bgr[u]

   # in future here will be a segmentation and tracking algorithm

   plot( imgRotate90Clockwise( img )  )

Does anybody has a tip? Is there a better choice for video image 
processing in R? Or, does native R support any internal speedup 

Thank you for any help. Bye

Dipl.-Ing. Philipp Fechteler
Department Image Processing
Fraunhofer Institute for Telecommunications
Heinrich-Hertz-Institut (HHI)
Einsteinufer 37
10587 Berlin, Germany
Phone	+49 30 31002 616
Fax	+49 30 31002 200
Email	philipp.fechteler at hhi.fraunhofer.de
WWW	http://iphome.hhi.de/fechteler

Visit us at

22. Treffpunkt Medizintechnik / Berlin, Germany / 22. May 2008 
Lehrgebaeude der Charite Berlin / 9.00 - 17:30 Uhr

ANGA Cable 2008 / Cologne, Germany / 27-29 May 2008 / Hall 10.3, Booth G38

More information about the R-help mailing list