scipy.ndimage.fourier_gaussian¶
- scipy.ndimage.fourier_gaussian(input, sigma, n=- 1, axis=- 1, output=None)[源代码]¶
多维高斯傅立叶过滤。
该阵列与高斯核的傅里叶变换相乘。
- 参数
- inputarray_like
输入数组。
- sigma浮点或序列
高斯核的σ。如果是花车, sigma 对于所有轴都是相同的。如果序列, sigma 必须为每个轴包含一个值。
- n整型,可选
如果 n 为负(默认),则假设输入是复数FFT的结果。如果 n 大于或等于零,则假定输入是实数FFT的结果,并且 n 给出变换前沿实际变换方向的数组长度。
- axis整型,可选
真实变换的轴。
- outputndarray,可选
如果给定,则将过滤输入的结果放入此数组中。在这种情况下不返回任何内容。
- 退货
- fourier_gaussianndarray
过滤后的输入。
示例
>>> 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_gaussian(input_, sigma=4) >>> result = numpy.fft.ifft2(result) >>> ax1.imshow(ascent) >>> ax2.imshow(result.real) # the imaginary part is an artifact >>> plt.show()