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

Home » Public Forums » archive » Re: "Max()" filter?
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: "Max()" filter? [message #29576 is a reply to message #29574] Thu, 07 March 2002 00:45 Go to previous messageGo to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
"Dick Jackson" <dick@d-jackson.com> wrote in message
news:Neth8.6463$Qq1.33877@shaw-ty2...


> I'd like a filter that uses the Max() function, so that this array:
>
> 1 4 2 4 3
> 3 5 2 1 4
> 5 7 4 3 1
> 3 5 1 1 2
> 3 1 2 3 1
>
> filtered with width 3 gives:
>
> 5 5 5 4 4
> 7 7 7 4 4
> 7 7 7 4 4
> 7 7 7 4 3
> 5 5 5 3 3
>
> (I think! :-)

Sorry for answering my own posting, but something at this late hour reminded
me that this sounds like a Dilate kind of thing. (maybe my pupils are
dilating! :-) Sure enough, it's just the Grayscale Dilate operation. Have to
be careful around the edges, padding with a ring of zeros, removing it
afterward.

If you're curious, it's all described in online help for Dilate, but here's
how it works (sorry for the terse code):

IDL> z0=byte(10*randomu(seed,5,5))
IDL> print,z0
0 3 6 7 3
4 1 0 4 5
3 3 4 5 0
6 3 7 5 2
5 1 8 0 9
IDL> z00=bytarr(7,7) ; make array padded with ring of zeros
IDL> z00[1,1]=z0
IDL> ; now dilate with 3x3 kernel and strip off ring
IDL> print,(dilate(z00,Replicate(1B,3,3),1,1,/gray))[1:5,1:5]
4 6 7 7 7
4 6 7 7 7
6 7 7 7 5
6 8 8 9 9
6 8 8 9 9


I imagine that using Erode will do the converse, what I'd call "Min()"
filtering.

Thanks for reading!

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: support (lack thereof) for Mac version of IDL5.5.1
Next Topic: Catching I/O errors on RESTORE

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

Current Time: Sat Oct 11 12:56:46 PDT 2025

Total time taken to generate the page: 0.80266 seconds