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

demo: anti-alias example using low-pass filter #120

Open
johnnychen94 opened this issue May 19, 2021 · 0 comments
Open

demo: anti-alias example using low-pass filter #120

johnnychen94 opened this issue May 19, 2021 · 0 comments

Comments

@johnnychen94
Copy link
Member

In the docstring of imresize:

This interpolates the values at sub-pixel locations. If you are shrinking the image, you risk aliasing unless you low-pass filter img first.

Yet we don't have a good showcase to tell potential users how this can be done.

Typically, we just apply a low-pass Gaussian filter to it. However, the example in the docstring is not very illustrative as it creates a over-blurred result:

using ImageFiltering
σ = map((o,n)->0.75*o/n, size(img), sz)
kern = KernelFactors.gaussian(σ)
imgr = imresize(imfilter(img, kern, NA()), sz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant