|
楼主 |
发表于 2008-5-28 18:51
|
显示全部楼层
恢复2楼
我一开始的代码是这样的,能否帮我运行看看?
A=zeros(128,128);
A(49:72,36:59)=7;
A(57:80,69:92)=9;
[x,y]=meshgrid(1:128,1:128);
a=1;
c=2;
b_x=64;
b_y=64;
gauss=zeros(128,128);
gauss=a*exp(-((x-b_x).^2+(y-b_y).^2)/c^2);
C=conv2(A,gauss,'same');
rC=fftshift(ifft2(fft2(C)./fft2(gauss))); %当c>3.9后会devide by zero,该句改为 rC=fftshift(ifft2(fft2(C)./(fft2(gauss)+eps))); ??
figure
subplot(131);imshow(A/max(max(A)),'InitialMagnification','fit');title('A');
subplot(132);imshow(C/max(max(C)),'InitialMagnification','fit');title('C=conv2(A,gauss)');
subplot(133);imshow(rC/max(max(rC)),'InitialMagnification','fit');title('recoverC');
[ 本帖最后由 yuyizhen2004 于 2008-5-28 18:56 编辑 ] |
|