On Thu, Sep 3, 2009 at 00:09, Sturla Molden<stu...@molden.no> wrote: > Chad Netzer skrev:
>> I'd also like to, if possible, have a specialized 2D version, since >> image media filtering is one of my interests, and the C version works >> on 1D (raveled) arrays only. > I agree. NumPy (or SciPy) could have a select module similar to the sort > module. If the select function takes an axis argument similar to the > sort functions, only a small change to the current np.median would needed. > > Take a look at this: > > http://projects.scipy.org/numpy/attachment/ticket/1213/_selectmodule.pyx > > Here is a select function that takes an axis argument. There are > specialized versions for 1D, 2D, and 3D. Input can be contiguous or not. > For 4D and above, axes are found by recursion on the shape array. Thus > it should be fast regardless of dimensions. 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. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion