【发布时间】:2013-06-20 05:42:17
【问题描述】:
我需要在 Python 中根据 .tiff 医学图像计算傅立叶系数。代码产生内存错误:
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
任何帮助将不胜感激!谢谢
【问题讨论】:
-
你的图片有多大,你有多少内存?
标签: python memory numpy scipy fft