7

I am trying to use the resize function using aliasing exactly as described in the documentation: http://scikit-image.org/docs/dev/auto_examples/transform/plot_rescale.html

from skimage.transform import resize
im_test = resize(im_test, (im_test.shape[0] / 3, im_test.shape[1] / 3),anti_aliasing=True)

However this returns:

Scikit image: resize() got an unexpected keyword argument 'anti_aliasing'

What is the reason for this? Is anti_aliasing on by default? What is the best way to resize an image with anti aliasing if this function can't be used?

sascha
  • 32,238
  • 6
  • 68
  • 110
ru111
  • 813
  • 3
  • 13
  • 27

2 Answers2

2

Checking the code here with git blame, it seems it was introduced on 19.09.2017.

The only release version supporting this currently should be: v0.13.1, which you will need then!

For checking, what kind of version you are using currently, i recommend opening your interpreter (of your used python-distribution) and do:

import skimage as sk
sk.__version__
# '0.13.0' i would not be able to use it, it seems
sascha
  • 32,238
  • 6
  • 68
  • 110
0

there are two sets of documentation

1) http://scikit-image.org/docs/dev/api/skimage.transform.html#skimage.transform.resize

2)http://scikit-image.org/docs/0.11.x/api/skimage.transform.html#resize

the second one doesn't accept anti_aliasing as a parameter and is the 0.11 version, the one that accepts anti aliasing is 0.14 looks like older version uses a box filter while resizing,and all pixels have equal weight

John Misquita
  • 119
  • 1
  • 4