Skip to content

Conversation

@johnnychen94
Copy link
Member

@johnnychen94 johnnychen94 commented Jun 25, 2023

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:

  • check the test
  • allow custom size input ImageFiltering.Kernel.LoG((0.5, 0.5), (5, 5))

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants