[Numpy-discussion] A faster median (Wirth's method)

Chad Netzer chad.netzer at gmail.com
Thu Sep 3 01:50:09 EDT 2009


On Wed, Sep 2, 2009 at 10:28 PM, Robert Kern<robert.kern at gmail.com> wrote:

> When he is talking about 2D, I believe he is referring to median
> filtering rather than computing the median along an axis. I.e.,
> replacing each pixel with the median of a specified neighborhood
> around the pixel.

That's right, Robert.  Basically, I meant doing a median on a square
(or rectangle) "view" of an array, without first having to ravel(),
thus generally saving a copy.  But actually, since my selection based
median overwrites the source array, it may not save a copy anyway.
But Charles Harris's earlier suggestion of some hard coded medians for
common filter template sizes (ie 3x3, 5x5, etc.) may be a nice
addition to scipy, especially if it can be generalized somewhat to
other filters.

-C



More information about the NumPy-Discussion mailing list