Re: [R] how to read individual values from a pixmap object

From: <Friedrich.Leisch_at_tuwien.ac.at>
Date: Thu 04 Aug 2005 - 22:06:30 EST

>>>>> On Thu, 4 Aug 2005 18:02:55 +1000, >>>>> Tony Gill (TG) wrote:

[...]

> Now I would like to read individual pixel values and store them in a
> separate vector. However I have not found a straight-forward way to do this.
 

> I thought that something like:
 

> x <- xGrey[1,1]
 

> would return the pixel value, but it seems to return a pixmap object with
> dimension 1x1 (i.e. only one pixel in size)
 

> xGrey[1,1]
> Pixmap image
> Type : pixmapGrey
> Size : 1x1
> Resolution : 1x1
> Bounding box : 1 0 2 1
 

> Any ideas on how to get the actual pixel value from a pixmap? (Note I could
> output to an ascii file and then read the file back in as text - but not
> nice!)

getChannels(xGrey) will get you the matrix of pixel values.

HTH,

-- 
-------------------------------------------------------------------
                        Friedrich Leisch 
Institut für Statistik                     Tel: (+43 1) 58801 10715
Technische Universität Wien                Fax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071
A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Aug 04 22:22:03 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:04:10 EST