clc;
clear;
I = imread('flowers.tif');
I = I(10+[1:256],222+[1:256],:);
V = .02;
LEN = 31;
THETA = 11;
PSF = fspecial('motion',LEN, THETA);
BlurredNoisy = imnoise(I,'gaussian',0,V);
figure;
subplot(121);imshow(I);
subplot(122);
imshow(BlurredNoisy);
V = .02;
NP = V*prod(size(I));
Edged = edgetaper(BlurredNoisy,PSF);
[reg1 LAGRA] = deconvreg(Edged,PSF,NP);
subplot(1,2,1), imshow(reg1), title('Restored with NP');
reg2 = deconvreg(Edged,PSF,NP*1.2);
subplot(1,2,2); imshow(reg2);
reg3 = deconvreg(Edged,PSF,[],LAGRA);
figure;
subplot(1,2,1); imshow(reg3);
reg4 = deconvreg(Edged,PSF,[],LAGRA*50);
subplot(1,2,2); imshow(reg4);
REGOP = [1 -2 1];
reg5 = deconvreg(Edged,PSF,[],LAGRA,REGOP);
figure; imshow(reg5);
|