Closed JeffFessler closed 2 years ago
8 months later - same issue
Sorry for the very late answer.
The doc. is wrong, for the spatial filter, you must specify a function (or a number which is the standard deviation of a Gaussian used as this function) and a window (a RectangularBox
or an odd integer interpreted as the width of the window in all dimensions). I will quickly fix the doc. and push an updated version.
Following your example, you can do something like:
bilateralfilter(rand(10,10), 3., 4., 7)
to use a 7×7 window along the dimensions of the input array.
It would be nice if there was a default rectangular window width (say, 4\sigma) but it's OK to require it too. Thanks!
Following your idea, I plan to have a default window width (an odd number) given by:
# Default window width for a given standard deviation σ.
default_width(σ::Real) = 2*round(Int, 3σ) + 1
I took 3σ
instead of 4σ
to avoid too large windows. Is that suitable to you?
I would call that 6σ (because of the 2*
) and that's actually what I had in mind originally. Thanks!
Looks great! I appreciate the changes coming.
@JeffFessler you're right, it's 6σ, I wrote "a window of size ±3σ" in the doc. and I sublitted a new version (1.2.1)
Closed via https://github.com/emmt/LocalFilters.jl/commit/17edf70873cb81f32eb3f097fb179b10ff362a16 and related commits.
Getting errors with basic bilateral filtering:
I've tried both the master branch and the tagged release.