Why skimage mean filter does not work on float array?
问题 I am going to apply a mean filter on an array of float with window_size=3 for example. I have found this library: from skimage.filters.rank import mean import numpy as np x=np.array([[1,8,10], [5,2,9], [7,2,9], [4,7,10], [6,14,10]]) print(x) print(mean(x, square(3))) [[ 1 8 10] [ 5 2 9] [ 7 2 9] [ 4 7 10] [ 6 14 10]] [[ 4 5 7] [ 4 5 6] [ 4 6 6] [ 6 7 8] [ 7 8 10]] but this function can't run on float arrays: from skimage.filters.rank import mean import numpy as np x=np.array([[1,8,10], [5,2,9