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

Home » Public Forums » archive » Re: not-quite meidan 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: not-quite meidan filter [message #72734 is a reply to message #72733] Thu, 30 September 2010 14:06 Go to previous messageGo to previous message
JJ is currently offline  JJ
Messages: 36
Registered: January 2007
Member
>
> So you're using a "mode" filter.  Try max(histogram(pixels)).  You
> should be careful to choose your binsize appropriately if you have non-
> integer data, however; or, alternatively you can use my statistical
> mode which finds the mode of a continuous distribution by maximizing
> the kernel density estimation.  If you'd like the code for that, let
> me know.

I think I see what you're suggesting, but unless I'm missing
something, it seems that I would still have to loop over all the
pixels in my image - which is exactly what I don't want to do. It's
good to know the name "mode" though.

I have worked up a solution which will work as long as I have a
limited number of possible values - my test case is only 53 distinct
values, which is OK. I create a 3D array with a slice for each
distinct value, where value of each slice is the coverage (0 or 1) for
that particular value. I then convol each slice with a simple box
kernel filled with 1's, which gives me number of instances of that
value in the box. Then I do a max (dim = 3) on the cube and get the
"max_subscripts", which I can then easily convert to the disticnt
value that I want.

This method is reasonably fast (especially compared to how long a loop
would take), but seems a little clunky and might cause trouble with a
lot more values. Come to think of it though, I don't need the whole
cube - I could just process one value at a time and just keep the
maximum so far.

Any better solutions appreciated.

Thanks.

-Jonathan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Color the points with different colors
Next Topic: Re: Help on Lon and lat.

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

Current Time: Fri Oct 10 21:03:05 PDT 2025

Total time taken to generate the page: 1.91508 seconds