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

Home » Public Forums » archive » Re: Majority 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: Majority Filter [message #83478 is a reply to message #83477] Fri, 08 March 2013 07:08 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On 3/7/13 7:46 PM, Jeremy Bailin wrote:
> On 3/7/13 2:18 PM, Coyote wrote:
>> Folks,
>>
>> Has anyone ever written a majority image filter in IDL? I wish to
>> filter out small incorrectly classified pixels floating in a sea of
>> correctly classified pixels in an image, before processing the image
>> further. These pixels have classification numbers, not data values. I
>> can imagine doing it in a FOR loop (or two), but these images are
>> large and I have a lot of them. :-(
>>
>> Cheers,
>>
>> David
>>
>
> Here's a quick stab at it.
>
> It does have a for loop, but it's just a loop through the classification
> values rather than a loop through pixels. You could always try using the
> double-histogram-trick if that's a problem. Also, it doesn't worry about
> edge effects (although it almost always gets the right answer even on
> the edge because of how IDL deals with out-of-bounds indexing in these
> cases), and it only worries about the majority-of-pixel criterion and
> not the contiguity criterion.
>

Incidentally, it should be pretty easy to implement the contiguity
criterion by using the output of LABEL_REGION... if you want a fully
optimized correct version, let me know, but I suspect that this is a
good enough base for you to fiddle with the details yourself. ;-)

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: NG save method
Next Topic: where, or, and loops. There has to be a better way.

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

Current Time: Fri Oct 10 17:13:08 PDT 2025

Total time taken to generate the page: 0.16231 seconds