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

Home » Public Forums » archive » STANDARD DEVIATON
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: STANDARD DEVIATON [message #21050 is a reply to message #20952] Fri, 04 August 2000 00:00 Go to previous messageGo to previous message
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
I wrote:

> It's possible I'm missing something

and then, about four seconds after I hit the submit button,
realised what it was I was missing: for a corner pixel of any given
9x9 area my method subtracts the mean of a different 9x9 area centred
on the corner pixel.

Still, my method is about twenty times faster than Ben_imageSD
which in turn is about four times faster than IDL_imageSD, so there's
a lot of incentive to find a hack.

The traditional way to speed up the loops would be to buffer the
calculation of the running average. For example, instead of adding
elements i-1, i, and i+1 of each row you remember the sum from last
time, subtract i-2 and add i+1. With a 9-element kernal this won't
help a lot, but it will a bit.

If you're not too worried about edge effects (and your posted code
wasn't), you could always create nine copies of the (float(image) -
localmean) array from my function, each with the localmean array
shifted by different amounts (use the SHIFT function to avoid
recalculation). Then you'd just have to shift them back to line up
the pixels, square them and take the sum. This could be done as a
loop over the 9x9 kernal elements if you don't have the memory or disk
space to hold all the copies in memory at once.


Struan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dear Santa: PVWAVE Style Date/Time Axes in IDL
Next Topic: Re: object newbie

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

Current Time: Sat Oct 11 09:14:12 PDT 2025

Total time taken to generate the page: 0.47878 seconds