ImageFiltering.jl
ImageFiltering.jl copied to clipboard
Strange automagic kernel centering depending on eltype
using ImageFiltering
@assert imfilter( [0, 0, 1, 0, 0], [1, 1]) == [ 1, 1 , 0, 0 , 0]
@assert imfilter(Float64[0, 0, 1, 0, 0], [1, 1]) ≈ [0.0, 1.0, 1.0, 0.0, 0.0]
Digging a bit into the implementation, it almost looks like the magic kernel centering is intended and the bug is that in the Int case there is no such centering?
https://github.com/JuliaImages/ImageFiltering.jl/blob/47fae0a0f5f23a44f6ecd895bc3576c0ae7ab337/src/imfilter.jl#L10 https://github.com/JuliaImages/ImageFiltering.jl/blob/47fae0a0f5f23a44f6ecd895bc3576c0ae7ab337/src/imfilter.jl#L1503
OTOH my impression was, that a design principle of this package is to avoid magic like implicit kernel centering?
If somebody can clarify I can make a PR to document the intended behavior and fix the unintended behavior.