Skip to content

ENH: ndimage: 1D rank filter speed up #20026

@gideonKogan

Description

@gideonKogan

Is your feature request related to a problem? Please describe.

During working on the Hampel filter, I implemented a median filter and tested it vs the current implementation. Obviously, there are some tests that I did not implement. Nevertheless, seems like for any window bigger than 5, the new implementation is faster. I checked vs the faster implementation scipy.ndimage.median_filter rather than the slower signal.medfilt

I wonder if I am missing something. Otherwise, is in the community's interest that I will continue the development and replace the current implementation?
Why do I think that the current implementation is slower? I think that they did not use the median heap. Obviously, in case I am right, it might lead to new implementations of rank filter too.

The testing code and the implementation are here:
image

Describe the solution you'd like.

No response

Describe alternatives you've considered.

No response

Additional context (e.g. screenshots, GIFs)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions