-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Troubles with median #4
Comments
A couple of notes here:
|
Wow, what a thorough, well-put, and intelligent response. Thanks, this answers a lot of questions, even ones I didn't know I had! I suppose I'll be keeping an eye out on this package and let it mature and seep into the various ecosystems. |
Is there a non allocating non mutating median without pre allocated buffer? |
There is one in this old pull request. I would want to avoid changing |
What's blocking the pull request? I am not sure I get what you mean, maybe an example? |
It says "Review required". I'm saying that you can reference a buffer from within your window function like this: const buf = zeros(3)
k = Kernel{(-1:1,)}(@inline w -> (copyto!(buf, Tuple(w)); median!(buf)) It should be as fast as you get using a heap-allocated buffer, but please benchmark for yourself. |
I was checking this package out and seeing if it would be able to replace some simple median-filtering code I've got in a package. Previously, I was using ImageFiltering.jl's
mapwindow(median!, ...)
to accomplish this. My solution using StaticKernels isThis fails due to the lack of
Base.iterate
for the window view passed tomedian!
(similarly fails formedian
. If I tryKernel{...}(w -> median(Tuple(w)))
the runtime explodes (like, I have to sigint the REPL).Am I missing something here?
The text was updated successfully, but these errors were encountered: