当观察到的图像是
在哪里是恢复的图像(是我想要恢复的图像)和是高斯噪声。
恢复,我解决了以下最小化问题:
其中是正则化系数,和 size( )。
我想使用 MATLAB 求解 PDE(欧拉-拉格朗日):
谁能帮我解决这个问题?谢谢!
我尝试了以下代码:
clear all, close all,clc
uor=imread('gourd.bmp'); % the original image
u0 = imnoise(uor,'gaussian',0,0.01);
u0=double(u0);
[m n]=size(u0);
uor=double(uor);
u=u0;
c=0.028;
h=1;
for Iter=1:50,
for i=2:m-1,
for j=2:n-1,
Lap=0.003*(u(i+1,j)+u(i-1,j)-4*u(i,j)+u(i,j+1)+u(i,j-1));
u(i,j)=(u0(i,j)+(1/(2*c*h*h))*Lap);
end
end
for i=2:m-1,
u(i,1)=u(i,2);
u(i,n)=u(i,n-1);
end
for j=2:n-1,
u(1,j)=u(2,j);
u(m,j)=u(m-1,j);
end
u(1,1)=u(2,2);
u(1,n)=u(2,n-1);
u(m,1)=u(m-1,2);
u(m,n)=u(m-1,n-1);
en=0.0;
for i=2:m-1,
for j=2:n-1,
ux=(u(i+1,j)-u(i,j))/h;
uy=(u(i,j+1)-u(i,j))/h;
fidelity=(u0(i,j)-u(i,j))*(u0(i,j)-u(i,j));
en=en+c*fidelity;
end
end
Energy(Iter)=en;
% Error between uor and u0
ur=reshape(u,m*n,1);
uori=reshape(uor,m*n,1);
residu=norm(ur-uori)/norm(uori);
[peaksnr, snr] = psnr(uor, u);
disp([' iter ' num2str(Iter), ' : Error = ' num2str(residu), ...
' , Peak-snr ' num2str(-peaksnr), ' , SNR ' num2str(snr)]);
end
% show the structural similarity index for measuring image quality
[ssimval, mapssim] = ssim(u,uor);
disp([' the structural similarity index is ' num2str(ssimval)]);
figure,imshow(mapssim,[]); axis square;
figure,imagesc(u); axis image; axis off; colormap(gray);
原图在这里: https ://www.dropbox.com/s/4bccby1f4lxp4j9/gourd.rar?dl=0
最好的祝福