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

Home » Public Forums » archive » Re: Median filter the hard way
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: Median filter the hard way [message #36726 is a reply to message #36725] Tue, 21 October 2003 16:29 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Tue, 21 Oct 2003 15:52:28 -0700, Dick Jackson wrote:


> "JD Smith" <> wrote in message
> news:pan.2003.10.17.22.22.14.73337.24537@as.arizona.edu...
>> On Fri, 17 Oct 2003 14:34:30 -0700, Dick Jackson wrote:
>>
>>> Here's an array, a:
>>>
>>> IDL> a=Float(Byte(RandomU(seed,7,7)*10)) IDL>
> a[2:4,2:4]=!values.F_nan
>>
>> [...]
>>
>>> The Convol function can be used to count up neighborhoods. If you
> need
>>> better counting around the edge, you could pad the array before
> calling
>>> Convol.
>>>
>>> IDL> print,Convol(Finite(a),Replicate(1B,3,3))
>>
>> Looks good, Dick. CONVOL's a bit heavy-handed for just counting: I'd
> use
>> smooth instead:
>>
>> IDL> print,smooth(finite(a)*9,3,/EDGE_TRUNCATE)
>>
>> [...]
>>
>> Notice it treats edges better (as far as this problem is concerned),
>
> Granted, if edge pixels are not going to be dropped anyway for having
> too few 'good' neighbors...
>
>> and should definitely be faster.
>
> A good guess, but in this case, I guess Convol can keep everything as
> Byte type and it is indeed faster:

This is the key (byte type). Change it to smooth(finite(a)*9b... and you
should see similar performance. Obviously, in this case, we're limited
by something other than the details of the addition.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: A complicate problem for building a map
Next Topic: MAP_IMAGE and Postscript

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

Current Time: Fri Oct 10 00:58:47 PDT 2025

Total time taken to generate the page: 0.95908 seconds