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

Home » Public Forums » archive » Filter image with moving window and averaging pixels
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: Filter image with moving window and averaging pixels [message #52434 is a reply to message #52350] Wed, 31 January 2007 15:52 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Wed, 31 Jan 2007 10:58:39 -0800, rpertaub@gmail.com wrote:

> Hello,
> I need to filter some noise out of an image and was pointed towards
> making a moving/sliding window (size, say 7x7) and compare the center
> pixel with surrounding pixels right next to border (ignoring middle
> pixels). And compare the value of center pixel with the border average
> pixels and thus filter out noise. However, I am not sure how to do
> this.
> Anyone has any idea?
> Did I say I was new to IDL...?
> Thanks for all your help,
> my last query was met by very helpful replies, and I am grateful!

I'd use CONVOL, e.g.:

kernel=fltarr(7,7)
kernel[0,*]=1.
kernel[6,*]=1.
kernel[*,0]=1.
kernel[*,6]=1.

imconv=convol(image,kernel,/CENTER,/EDGE_TRUNCATE)/(4*7-4)
bad=where(abs(image-imconv) gt threshold)

Then again, a box median might be just as good of a statistic, especially
if coupled to a box standard deviation. The former is easy, the latter
requires some SMOOTH trickery, discussed several times here.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: netCDF/CF conventions
Next Topic: Removing fields from a structure

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

Current Time: Fri Oct 10 16:04:05 PDT 2025

Total time taken to generate the page: 0.00683 seconds