JuliaImages / ImageFiltering.jl

Julia implementations of multidimensional array convolution and nonlinear stencil operations
Other
99 stars 51 forks source link

WIP: tweak LoG kernel value #261

Open johnnychen94 opened 1 year ago

johnnychen94 commented 1 year ago

We would expect laplacian kernel sum to zero, while the current implementation doesn't meet this:

julia> h = ImageFiltering.Kernel.LoG((0.5, 0.5))
5×5 OffsetArray(::Matrix{Float64}, -2:2, -2:2) with eltype Float64 with indices -2:2×-2:2:
 8.59705e-6  0.00208098   0.0119595  0.00208098  8.59705e-6
 0.00208098  0.279842     0.689257   0.279842    0.00208098
 0.0119595   0.689257    -5.09296    0.689257    0.0119595
 0.00208098  0.279842     0.689257   0.279842    0.00208098
 8.59705e-6  0.00208098   0.0119595  0.00208098  8.59705e-6

julia> sum(h)
-1.1520408898110324

This PR tries to fix it.

TODO:

This is a very quick submission in case I forget about it.