我需要从 .tiff 医学图像中计算 Python 中的傅立叶系数。该代码产生内存错误:
for filename in glob.iglob ('*.tif'):
imgfourier = scipy.misc.imread (filename, flatten = True)
image = numpy.array([imgfourier])#make an array
# Take the fourier transform of the image.
F1 = fftpack.fft2(image)
# Now shift so that low spatial frequencies are in the center.
F2 = fftpack.fftshift(F1)
# the 2D power spectrum is:
psd2D = np.abs(F2)**2
print psd2D
任何帮助将非常感激!谢谢