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 #32667 is a reply to message #32582] Tue, 22 October 2002 22:18 Go to previous message
David Oesch is currently offline  David Oesch
Messages: 31
Registered: October 2000
Member
<html>
<head>
</head>
<body>
<br>
<br>
Jaco van Gorkom wrote:<br>
<blockquote type="cite" cite="mid:ap3uhr$erme$1@zam602.zam.kfa-juelich.de">
<pre wrap="">"Craig Markwardt" <a class="moz-txt-link-rfc2396E" href="mailto:craigmnet@cow.physics.wisc.edu">&lt;craigmnet@cow.physics.wisc.edu&gt;</a> wrote in message<br><a class="moz-txt-link-freetext" href="news:onznt6k38x.fsf@cow.physics.wisc.edu">news:onznt6k38x.fsf@cow.physics.wisc.edu</a>...<br></pre>
<blockquote type="cite">
<pre wrap="">David Oesch <a class="moz-txt-link-rfc2396E" href="mailto:oesch@giub.unibe.ch">&lt;oesch@giub.unibe.ch&gt;</a> writes:<br></pre>
<blockquote type="cite">
<pre wrap=""> ...<br>Does anyone have an algorithm for finding the mean/standardeviation etc<br>at each pixel position for a set of equal size 2-D images? Currently the<br>only way I have to do this is to extract all the values for a given<br>pixel position into a 1-D array and find the mean/standardeviation etc<br>on that. Doing it pixel by pixel like this is inefficient in IDL so I am<br>looking for an *array* based algorithm that would find all<br>the mean/standardeviation etc in parallel. ...<br></pre>
</blockquote>
<pre wrap="">Sure, if you stack your image into a 3D image cube, then you would<br>have something like IMAGE = FLTARR(NX, NY, NIMAGES)<br><br>Then the mean image is:<br><br> mean = total(image,3)/nimages<br><br>The standard deviation is:<br><br> meancube = rebin(reform(mean,nx,ny,1),nx,ny,nimages)<br> std = sqrt(total((image - meancube)^2,3)/(nimages-1))<br><br>Now, what you meant by "etc" can get a little hairier. If you want to<br>do median you are probably in trouble, but min and max are easy too:<br><br> minimage = image(*,*,0)<br> maximage = minimage<br> for i = 1, nimages-1 do begin<br> minimage = minimage &lt; image(*,*,i)<br> maximage = maximage &gt; image(*,*,i)<br> endfor<br></pre>
</blockquote>
<pre wrap=""><!----><br>I believe that IDL 5.5 offers the luxury of<br> maximage = MAX(image, MIN=minimage, DIMENSION=3)<br><br>As for median, well, there was a thread on "Finding the median of a set<br>of images" back in '96. Should be valid still, I guess. Improvising with<br>transpose(), reform(), median(image, Nimages) and rebin() should be fun, but<br>not be very fast.<br><br> Jaco<br><br><br></pre>
</blockquote>
Ok, I think now is the time to upgrade from IDL 5.4 to 5.5 :-)....<br>
<br>
Thanks for your tips<br>
<br>
Dave<br>
</body>
</html>
[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: Sat Oct 11 10:27:16 PDT 2025

Total time taken to generate the page: 0.16525 seconds