scipy.ndimage.fourier_ellipsoid¶
- scipy.ndimage.fourier_ellipsoid(input, size, n=- 1, axis=- 1, output=None)[源代码]¶
多维椭球傅里叶过滤。
该阵列与给定大小的椭球体的傅里叶变换相乘。
- 参数
- inputarray_like
输入数组。
- size浮点或序列
用于筛选的框的大小。如果是花车, size 对于所有轴都是相同的。如果序列, size 必须为每个轴包含一个值。
- n整型,可选
如果 n 为负(默认),则假设输入是复数FFT的结果。如果 n 大于或等于零,则假定输入是实数FFT的结果,并且 n 给出变换前沿实际变换方向的数组长度。
- axis整型,可选
真实变换的轴。
- outputndarray,可选
如果给定,则将过滤输入的结果放入此数组中。在这种情况下不返回任何内容。
- 退货
- fourier_ellipsoidndarray
过滤后的输入。
注意事项
此函数针对秩为1、2或3的数组实现。
示例
>>> from scipy import ndimage, misc >>> import numpy.fft >>> import matplotlib.pyplot as plt >>> fig, (ax1, ax2) = plt.subplots(1, 2) >>> plt.gray() # show the filtered result in grayscale >>> ascent = misc.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()