Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange automagic kernel centering depending on eltype #245

Open
jw3126 opened this issue Feb 24, 2022 · 2 comments
Open

Strange automagic kernel centering depending on eltype #245

jw3126 opened this issue Feb 24, 2022 · 2 comments

Comments

@jw3126
Copy link
Collaborator

jw3126 commented Feb 24, 2022

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]
@jw3126
Copy link
Collaborator Author

jw3126 commented Feb 24, 2022

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?

imfilter(T, img, factorkernel(kernel), args...)

factorkernel(kernel::AbstractArray) = (kernelshift(axes(kernel), kernel),)

OTOH my impression was, that a design principle of this package is to avoid magic like implicit kernel centering?

@jw3126
Copy link
Collaborator Author

jw3126 commented Feb 24, 2022

If somebody can clarify I can make a PR to document the intended behavior and fix the unintended behavior.

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

No branches or pull requests

1 participant