[R] image processing and plotting at video rates ?

From: Philipp Fechteler <philipp.fechteler_at_hhi.fraunhofer.de>
Date: Fri, 11 Apr 2008 23:55:04 +0200


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 possibilities?

Thank you for any help. Bye
Philipp

-- 

________________________________________________________________________
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 http://www.tsbmedici.de ANGA Cable 2008 / Cologne, Germany / 27-29 May 2008 / Hall 10.3, Booth G38 http://www.angacable.com ______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Fri 11 Apr 2008 - 23:00:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 12 Apr 2008 - 03:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive