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()