Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ImageFiltering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ArrayLike{T} = Union{ArrayType{T}, AnyIIR{T}}

include("kernel.jl")
using .Kernel
using .Kernel: Laplacian, reflect, ando3, ando4, ando5, scharr, bickley, prewitt, sobel, gabor, moffat
using .Kernel: Laplacian, reflect, ando3, ando4, ando5, scharr, bickley, prewitt, sobel, gabor, moffat, butterworth

NDimKernel{N,K} = Union{AbstractArray{K,N},ReshapedOneD{K,N},Laplacian{N}}

Expand Down
9 changes: 9 additions & 0 deletions src/kernel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,15 @@ moffat(α::Real, β::Real) = moffat(α, β, ceil(Int, (α*2*sqrt
sum(x.^2)
end

function butterworth(n::Real,Wn::Real,ls::Tuple{Integer, Integer})
ws = map(n->(ceil(Int,n)>>1), ls)
R = CartesianIndices(map(w->IdentityUnitRange(-w:w), ws))
nn = 2*n
@. 1/(1+(sqrt(2)-1)*(df(R)/Wn)^nn)
end

butterworth(n::Real,Wn::Real,ls::Tuple{Integer, Integer}) = butterworth(n, Wn, (ls,ls))

"""
reflect(kernel) --> reflectedkernel

Expand Down