reading pixels from images from automated XYpositions [message #39012] |
Wed, 14 April 2004 09:50 |
Thomas Nehls
Messages: 24 Registered: March 2004
|
Junior Member |
|
|
Hi folks,
I want to get information(mean, stddev, median) about the values of
certain pixels(7x7 pixels areas) from an image.
The according XY positions should be read from a file, where a list of
positions is given.
This is, what I thought could work:
> PRO input,x
>
> FOR n=0,x-1 do grey_scale_value,n
> END
>
> PRO grey_scale_value, n,x
> file = DIALOG_PICKFILE(/READ)
> img = READ_TIFF(file)
> positions = DIALOG_PICKFILE(/READ)
> pos =bytarr(3,6)
> pos = READ_SYLK(positions,/ARRAY)
> pixels1 = img[0,23:26,35:38]
> pixels2 = img[0,(pos[1]-3 where pos[0]=n):(pos[1]+3 where pos[0]=n),(pos[2]-3 where pos[0]=n):(pos[2]+3 where pos[0]=n)]
>
> OPENW,1,'greyscale_data.dat',/APPEND
> PRINTF,1, (n+1),mean(pixels2),stddev(pixels2),median(pixels2)
> CLOSE,1
> END
first I tried pixels1, the scheme works, but I think I used the 'where'
command in the wrong way...
Do you have a hint for me?
Thanks
Tom
|
|
|