[R] identify with image

Kenneth Cabrera krcabrer at unalmed.edu.co
Tue Sep 2 22:37:52 CEST 2003


Hi, Dr Halvorsen

Try
identify(expand.grid(1:512,1:512))

But, be careful with the index of the matrix (image)



On Tue, 02 Sep 2003 15:31:45 -0400, kjetil brinchmann halvorsen 
<kjetil at entelnet.bo> wrote:

> Hola!
>
> I will want to identify pixels in an image with the mouse, for so getting 
> the image data from the matrix(es), for use in subsequent discriminant 
> analysis. But the following bombs R:
> (windows XP, rw1071)
>
>> str(baboon)
> list()
> - attr(*, "size")= int [1:2] 512 512
> - attr(*, "cellres")= num [1:2] 1 1
> - attr(*, "bbox")= num [1:4] 0 0 512 512
> - attr(*, "channels")= chr "grey"
> - attr(*, "bbcent")= logi FALSE
> - attr(*, "class")= chr "pixmapGrey"
> - attr(*, "grey")= num [1:512, 1:512] 0.537 0.510 0.345 0.259 0.322 ...
>> class(baboon)
> [1] "pixmapGrey"
>> library(pixmap)
>> plot(baboon)
>> identify(baboon, n=1)
>
> ... and then R bombs!
>
> What to do?
>
> Kjetil Halvorsen
>
> ______________________________________________
> 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