-
Notifications
You must be signed in to change notification settings - Fork 2
/
Fig3.m
52 lines (48 loc) · 1.7 KB
/
Fig3.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
%%%% codes for reproduce Fig. 3
%%%% We want to compare the quality of the extracted SPN by DWT and DTCWT.
%%%% High quality SPN means that high similarity with the groud truth SPN.
clc,clear,
close all
addpath('Functions')
addpath('Filter')
addpath('Functions\DTCWT')
clean = double(imread('circlesBrightDark.png')); % We use the pic of Matlab
clean = clean(351:351+127,201:201+127); % X Fig. 2(a)
% figure,
% imshow(uint8(clean),'border','tight');
% title('Clean image')
sigma = 5;
L = 4; % decomposition level
iter = 500;
SimilarityO = zeros(size(clean));
SimilarityD_P = zeros(size(clean));
Similarity = zeros(size(clean));
for i = 1:iter
SeeProgress(i)
randn('seed',i);
Fingerprint = sigma*randn(128);
imx = clean + Fingerprint;
%%%%%%%%%%%%%
qmf = MakeONFilter('Daubechies',8);
Noisex = NoiseExtract_nopadding(imx,qmf,sigma,L);
%%%%%%%%%%%%%%%%
dwtmode('per')
denoised_dtcwt = denC2D_dwt(imx,sigma);
Noisex_C2Dper = imx-denoised_dtcwt;
% %%%%%%%%%%%%%%%%
dwtmode('symw')
denoised_dtcwt = denC2D_dwt(imx,sigma);
Noisex_C2Dsymw = imx-denoised_dtcwt;
SimilarityO = SimilarityO + Noisex.*Fingerprint;
SimilarityD_P = SimilarityD_P + Noisex_C2Dper.*Fingerprint;
Similarity = Similarity + Noisex_C2Dsymw.*Fingerprint;
end
figure,subplot(131),
imshow(SimilarityO/iter,[0 20],'border','tight'),
title('Similarity map with DWT')
subplot(132),
imshow(SimilarityD_P/iter,[0 20],'border','tight'),
title('Similarity map with DTCWT(per)')
subplot(133),
imshow(Similarity/iter,[0 20],'border','tight'),
title('Similarity map with DTCWT(symw)')