-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSavePSNRMC.m
119 lines (109 loc) · 2.59 KB
/
SavePSNRMC.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
clear,clc
file_path = '.\ucid.v2\';% 图像文件夹路径
imgjpg = dir(fullfile(fullfile(file_path),'*.jpg'));%获取该文件夹中所有jpg格式的图像
imgbmp = dir(fullfile(fullfile(file_path),'*.bmp'));
imgtif = dir(fullfile(fullfile(file_path),'*.tif'));
filenames1 = {imgjpg.name}';
filenames2 = {imgbmp.name}';
filenames3 = {imgtif.name}';
filename = [filenames1;filenames2;filenames3];
% t1 = clock;
% QS = [];
% percent = 0.2;
% for k = 1:length(filename)
% disp(k)
% P = imread(strcat(file_path,filename{k}));
% if length(size(P))==3
% GP = rgb2gray(P);
% else
% GP = P;
% end
% [m,n]=size(GP);
% BinaryList = randi([0,1],[1,floor(percent*m*n)]);
% Tmc = Standard_F(GP,BinaryList);
% QS = [QS,Tmc];
% end
% t2 = clock;
% t = etime(t2,t1);
% disp('0.2 Successful!');
% save MC_ucid0_2.mat QS t
% t1 = clock;
% QS = [];
% percent = 0.4;
% for k = 1:length(filename)
% disp(k)
% P = imread(strcat(file_path,filename{k}));
% if length(size(P))==3
% GP = rgb2gray(P);
% else
% GP = P;
% end
% [m,n]=size(GP);
% BinaryList = randi([0,1],[1,floor(percent*m*n)]);
% Tmc = Standard_F(GP,BinaryList);
% QS = [QS,Tmc];
% end
% t2 = clock;
% t = etime(t2,t1);
% disp('0.4 Successful!');
% save MC_ucid0_4.mat QS t
t1 = clock;
QS = [];
percent = 0.6;
for k = 1:length(filename)
disp(k)
P = imread(strcat(file_path,filename{k}));
if length(size(P))==3
GP = rgb2gray(P);
else
GP = P;
end
[m,n]=size(GP);
BinaryList = randi([0,1],[1,floor(percent*m*n)]);
Tmc = Standard_F(GP,BinaryList);
QS = [QS,Tmc];
end
t2 = clock;
t = etime(t2,t1);
disp('0.6 Successful!');
save MC_ucid0_6.mat QS t
% t1 = clock;
% QS = [];
% percent = 0.8;
% for k = 1:length(filename)
% disp(k)
% P = imread(strcat(file_path,filename{k}));
% if length(size(P))==3
% GP = rgb2gray(P);
% else
% GP = P;
% end
% [m,n]=size(GP);
% BinaryList = randi([0,1],[1,floor(percent*m*n)]);
% Tmc = Standard_F(GP,BinaryList);
% QS = [QS,Tmc];
% end
% t2 = clock;
% t = etime(t2,t1);
% disp('0.8 Successful!');
% save MC_ucid0_8.mat QS t
% t1 = clock;
% QS = [];
% percent = 1;
% for k = 1:length(filename)
% disp(k)
% P = imread(strcat(file_path,filename{k}));
% if length(size(P))==3
% GP = rgb2gray(P);
% else
% GP = P;
% end
% [m,n]=size(GP);
% BinaryList = randi([0,1],[1,floor(percent*(m*n-2))]);
% Tmc = Standard_F(GP,BinaryList);
% QS = [QS,Tmc];
% end
% t2 = clock;
% t = etime(t2,t1);
% disp('1 Successful!');
% save MC_ucid1_0.mat QS t