Chris
Chris

Reputation: 155

scipy ndimage has no attribute filter?

I installed ndimage with sudo pip3 install scipy

then i'm importing it as import scipy.ndimage

then i'm doing the following line b=scipy.ndimage.filter.gaussian_filter(i,sigma=10)

and I get AttributeError: module 'scipy.ndimage' has no attribute 'filter' Anyone encountered this before?

Upvotes: 1

Views: 1317

Answers (2)

aterzgar
aterzgar

Reputation: 1

For python3, it can be used like below, no need to add scipy.

from scipy.ndimage import filters
my_image2 = filters.gaussian_filter(my_image,10)

Upvotes: 0

Chris
Chris

Reputation: 155

Found it! It should have been b=scipy.ndimage.filters instead of filter

Upvotes: 1

Related Questions