scipy.ndimage.
fourier_ellipsoid#
- scipy.ndimage.fourier_ellipsoid(input, size, n=-1, axis=-1, output=None)[源代码]#
多维椭球傅里叶滤波器。
数组与给定尺寸的椭球体的傅里叶变换相乘。
- 参数:
- input类数组对象
输入数组。
- size浮点数或序列
用于滤波的框的尺寸。如果是浮点数,size 对所有轴都相同。如果是序列,size 必须包含每个轴的一个值。
- n整数,可选
如果 n 为负数(默认),则输入被假定为复数 FFT 的结果。如果 n 大于或等于零,则输入被假定为实数 FFT 的结果,并且 n 给出在实数变换方向上变换前数组的长度。
- axis整数,可选
实数变换的轴。
- outputndarray,可选
如果给出,输入滤波的结果将放置在此数组中。
- 返回:
- fourier_ellipsoidndarray
滤波后的输入。
注意
此函数适用于秩为 1、2 或 3 的数组。
示例
>>> from scipy import ndimage, datasets >>> import numpy.fft >>> import matplotlib.pyplot as plt >>> fig, (ax1, ax2) = plt.subplots(1, 2) >>> plt.gray() # show the filtered result in grayscale >>> ascent = datasets.ascent() >>> input_ = numpy.fft.fft2(ascent) >>> result = ndimage.fourier_ellipsoid(input_, size=20) >>> result = numpy.fft.ifft2(result) >>> ax1.imshow(ascent) >>> ax2.imshow(result.real) # the imaginary part is an artifact >>> plt.show()