Re: Finding the mean of a set of images [message #32660 is a reply to message #32589] |
Wed, 23 October 2002 09:54  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
David Oesch wrote:
>
>
> Jaco van Gorkom wrote:
>
>> "Craig Markwardt" <craigmnet@cow.physics.wisc.edu> wrote in message
>> news:onznt6k38x.fsf@cow.physics.wisc.edu...
>>
>>> David Oesch <oesch@giub.unibe.ch> writes:
>>>
>>>> ...
>>>> Does anyone have an algorithm for finding the mean/standardeviation etc
>>>> at each pixel position for a set of equal size 2-D images? Currently the
>>>> only way I have to do this is to extract all the values for a given
>>>> pixel position into a 1-D array and find the mean/standardeviation etc
>>>> on that. Doing it pixel by pixel like this is inefficient in IDL so I am
>>>> looking for an *array* based algorithm that would find all
>>>> the mean/standardeviation etc in parallel. ...
>>>>
>>> Sure, if you stack your image into a 3D image cube, then you would
>>> have something like IMAGE = FLTARR(NX, NY, NIMAGES)
>>>
>>> Then the mean image is:
>>>
>>> mean = total(image,3)/nimages
>>>
>>> The standard deviation is:
>>>
>>> meancube = rebin(reform(mean,nx,ny,1),nx,ny,nimages)
>>> std = sqrt(total((image - meancube)^2,3)/(nimages-1))
>>>
>>> Now, what you meant by "etc" can get a little hairier. If you want to
>>> do median you are probably in trouble, but min and max are easy too:
>>>
>>> minimage = image(*,*,0)
>>> maximage = minimage
>>> for i = 1, nimages-1 do begin
>>> minimage = minimage < image(*,*,i)
>>> maximage = maximage > image(*,*,i)
>>> endfor
>>>
>>
>> I believe that IDL 5.5 offers the luxury of
>> maximage = MAX(image, MIN=minimage, DIMENSION=3)
>>
>> As for median, well, there was a thread on "Finding the median of a set
>> of images" back in '96. Should be valid still, I guess. Improvising with
>> transpose(), reform(), median(image, Nimages) and rebin() should be fun,
>> but not be very fast.
>>
>> Jaco
>>
>>
> Well it works fine in 5.5 , but this feature is not explained in the help
> of the idl 5.5 WIN/PC edition
> ... in 5.5
> the help is obviously still the help of 5.4...
Yes
and there was a big threat already about this
Ben and Andrew have developed their cool_help tool
which is a idl widget to search to the entire idl5.5 help.
http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&am p;threadm=pan.2002.07.22.18.34.47.124252.19863%40as.arizona. edu&rnum=9&prev=/groups%3Fq%3Dhelp%2B%252B2002%2Bgro up:comp.lang.idl-pvwave%26hl%3Dde%26lr%3D%26ie%3DUTF-8%26sel m%3Dpan.2002.07.22.18.34.47.124252.19863%2540as.arizona.edu% 26rnum%3D9
www.tidewater.net/~pemaquid.
All changes are described in the whats_new pdf file too.
Reimar
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|
|
|