N=512;A=zeros(N,N);B=zeros(N,N);forI=1:1:256J=1:1:256ImageNum=double(Image(I,J,1));A(I,J)=ImageNum/255;B(I,J)=0;endendfigure;imshow(A);pi=3.1415926;forI=1:1:NforJ=1:1:NR=rand(1,1);%生成一个元素在0,1之间均匀分布的随机矩阵RB(I,J)=A(I,J)*sin(R*2*pi);%平滑函数的傅里叶变换谱A(I,J)=A(