Closed yha closed 5 years ago
Since it's named as "imfilter", I'm curious that how would you interpret Points as an image, and what's the meaning of filtering a point array?
I'm not interpreting the Points as an image, but as a curve in 2D. Filtering the curve with a gaussian kernel smooths it, so it's a simple (naive) way to try to recover the "actual" curve from noisy Point
data.
I'm using ImageFiltering.jl
because I find the interface much nicer for this purpose than that of DSP.jl
(it's easy to get the indexes and boundary conditions right). It worked perfectly fine until I tried larger kernels.
It worked perfectly fine until I tried larger kernels.
Yes, perhaps you already know it, if you call imfilter(x, y)
directly, there will be a step that infers the "optimal" filtering strategy. Currently >30
would trigger the FFT
algorithm.
I think at least FIR should be automatically chosen regardless of kernel size for those types.
LGTM, unfortunately, I don't have enough time recently to support this; I have a plan to update the whole package in the future.
Yes, the package should probably drop the Image part of its name, it has been confusing before. There is no good reason not to support non-images.
You're spot-on that in this case a custom channelview
is all you need if you want to use FFT. (Or just reinterpret
.) But it's not good for it error. Fix in a moment.
The docs seems to suggest that arrays with arbitrary element types can be filtered, but it fails depending on kernel size, e.g.,
imfilter
works fine in this example if the kernel is smaller or if explicitly choosingIf FFT is not supported for types other than numbers/Colorants, I think at least FIR should be automatically chosen regardless of kernel size for those types. Ideally, maybe FFT can be supported for other types by the user providing custom
channelview
or somthing similar.