scipy.ndimage.
fourier_shift#
- scipy.ndimage.fourier_shift(input, shift, n=-1, axis=-1, output=None)[源代码][源代码]#
多维傅里叶移位滤波器。
该数组与移位操作的傅里叶变换相乘。
- 参数:
- 返回:
- fourier_shiftndarray
移位的输入。
示例
>>> from scipy import ndimage, datasets >>> import matplotlib.pyplot as plt >>> import numpy.fft >>> 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_shift(input_, shift=200) >>> result = numpy.fft.ifft2(result) >>> ax1.imshow(ascent) >>> ax2.imshow(result.real) # the imaginary part is an artifact >>> plt.show()