画像処理の数値結果を .xls ファイルに 1 行で正確に水平方向のセルに出力したいのですが、どの Python モジュールを使用し、どのコードを追加すればよいかアドバイスをいただけないでしょうか? つまり、配列から数字を並べて、Excel セルに正確に水平に配置する方法は?
Code fragment:
def fouriertransform(self): #function for FT computation
for filename in glob.iglob ('*.tif'):
imgfourier = mahotas.imread (filename) #read the image
arrayfourier = numpy.array([imgfourier])#make an array
# Take the fourier transform of the image.
F1 = fftpack.fft2(imgfourier)
# 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
f.write(str(psd2D))#write to file