-
Notifications
You must be signed in to change notification settings - Fork 1
/
test2.m
37 lines (32 loc) · 1000 Bytes
/
test2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
clear
close all
% I=(imread ('lenaBW.tif'));
I=(imread ('x-ray.tif'));
% I=imread ('cameraman.tif');
nome='cameraman';
for n=1:10
dim=0;
noise=n/1000;
R=imnoise(I,'gaussian',0,noise);
for i=3:4:31
dim=dim+1;
t=cputime;
R1= wiener2(R,[i i],noise);
tfin=cputime;
time1(dim,n)=tfin-t;
nom1=char("../../../../../Scrivania/img/avg"+nome+"-"+string(num2str(n))+'-'+string(num2str(i))+".tif")
imwrite(R1,nom1,'tif');
err_Wiener2(dim,n)=immse(R1,I)
t=cputime;
R2=imadvfilter2(R,i,noise,1.25);
tfin=cputime;
time2(dim,n)=tfin-t;
nom2=char("../../../../../Scrivania/img/adv"+nome+"-"+string(num2str(n))+'-'+string(num2str(i))+".tif")
imwrite(R2,nom2,'tif');
err_advfilter2(dim,n)=immse(R2,I)
end
end
TempoMedioWiener2=mean(time1(:))
TempoMedioAdvFilter=mean(time2(:))
TempoTotaleWiener2=sum(time1(:))
TempoTotaleAdvFilter=sum(time2(:))