我认为也许
rfft2是执行错误的轴。默认情况下,它使用最后两个轴:
axes=(-2,-1)。第三个轴代表RGB通道。取而代之的是,似乎更愿意在空间轴上执行FFT
axes=(0,1):
import Imageimport numpy as npi = Image.open('image.png').convert('RGB')a = np.asarray(i, np.uint8)print(a.shape)b = abs(np.fft.rfft2(a,axes=(0,1)))b = np.uint8(b)j = Image.fromarray(b)j.save('/tmp/img2.png')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)