comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Finding the mean of a set of images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Finding the mean of a set of images [message #32582 is a reply to message #32578] Tue, 22 October 2002 09:33 Go to previous messageGo to previous message
Jaco van Gorkom is currently offline  Jaco van Gorkom
Messages: 97
Registered: November 2000
Member
"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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: WINDOW, /PIXMAP Question
Next Topic: Re: what is the most convenient way to read an image generated by ENVI in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 17:51:41 PDT 2025

Total time taken to generate the page: 0.48247 seconds