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

Home » Public Forums » archive » Re: 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 #20949 is a reply to message #20946] Tue, 01 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
Ben Marriage, ben@met.ed.ac.uk writes:

> I want to calculate the standard deviation of a 3x3
> pixel area for each element of a satellite image
>
> Does anyone know of a simple and elegant (read "quick")
> method of doing this without using loops?

You can use a box smooth to do the local averaging and
renormalisation, with variable widths if needed. If you use the fact
that the s.d. is the square root of the local variance, you'll need to
smooth twice: once when calulating a local mean, and again when
creating the s.d. array.


function imageSD, image

localmean = smooth(float(image), 3, /edge_truncate)
localsd = sqrt((float(image)-temporary(localmean))^^2)
localsd = smooth(temporary(localsd), 3, /edge_truncate)

return, localsd

end

You can set different edge-effects and averaging widths by passing
different parameters to the box smooth function. The box smooth
normalises by the square of the smoothing width, so if you want to
treat the image as a estimate of a population you'll have to
renormalise - but this is pretty unlikely with image data.


Struan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IMDISP update
Next Topic: Re: Record Day on IDL Newsgroup

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

Current Time: Mon Dec 01 02:48:35 PST 2025

Total time taken to generate the page: 2.40642 seconds