scipy.ndimage.

fourier_ellipsoid#

scipy.ndimage.fourier_ellipsoid(input, size, n=-1, axis=-1, output=None)[source]#

多維橢球傅立葉濾波器。

陣列會與給定大小的橢球傅立葉轉換相乘。

參數:
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()
../../_images/scipy-ndimage-fourier_ellipsoid-1.png