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

Home » Public Forums » archive » not-quite meidan filter
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
not-quite meidan filter [message #72740] Thu, 30 September 2010 12:38
JJ is currently offline  JJ
Messages: 36
Registered: January 2007
Member
I would like to do something that is similar to, but not quite the
same as, a median filter to a 2D array. Instead of choosing the
median value in a box surrounding each pixel, I would like to chose
the value in that box that occurs most frequently.

For example, if I had

1 1 1 1 1
1 1 1 1 1
2 2 2 2 2
2 2 3 3 3
3 3 3 3 3

The median would be 2, but I would want the value 1 (it occurs 10
times, which is more than the 8 instances of the value 3 or the 7
instances of the value 2).

Can anyone think of a clever way to do this that would be fast in IDL
(ie, no looping through the pixels)? I need it to work for box sizes
up to around 21. Ties may be broken arbitrarily.

Is there already a name for this concept?

Thanks.

-Jonathan
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: while running mdefringe.pro
Next Topic: Re: while running mdefringe.pro

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

Current Time: Fri Oct 10 11:24:25 PDT 2025

Total time taken to generate the page: 0.96058 seconds