A list,
Wavelet transform principle
Wavelet transform is a time-scale (time-frequency) analysis method of signal. It is a time-frequency localization analysis method that the window size is fixed and the shape can be changed. Both the time window and the frequency window can be changed. It has the characteristics of multi-resolution Analysis, and has the ability to characterize the local characteristics of the signal in both time and frequency domains.
The wavelet analysis method has high frequency resolution and low time resolution in the low frequency part, and high time partitioning rate and low frequency partitioning rate in the high frequency part, so it is known as “mathematical microscope”. It is this characteristic that makes wavelet transform adaptive to signal.
Wavelet analysis is as a harmonic analysis for half a century in the field of the mathematical crystallization, has been widely used in signal processing, image processing, quantum field theory, seismic exploration, speech recognition and synthesis, music, radar, CT imaging, color copies, fluid turbulence, object recognition, machine vision, mechanical fault diagnosis and monitoring, fractal and digital TV and other areas of science and technology.
In principle, where Fourier analysis is traditionally used, wavelet analysis can be used instead. The advantage of wavelet analysis over Fourier transform is that it has good localization property in both time domain and frequency domain.
In this way, the wavelet transform is modulatory to the sampling steps of different frequencies in the time domain: at low frequencies, the time resolution of the wavelet transform is lower, and the frequency partitioning rate is higher; At high frequency, the time resolution of wavelet transform is higher, but the class resolution is lower. This is in line with the low frequency signal changes slowly and high frequency signal changes rapidly.
That’s where it beats the classical Fourier transform and the short-time Fourier transform.
Ii. Source code
%%% clear; %%% clear; W = imread('lena.tif');
s = size(W);
r = randsample(s(1), s(1));
W1 = W(r, :, :);
c = randsample(s(2), s(2));
W2 = W1(:, c, :);
i = 1; f = 1:length(c);
while i <= length(c)
f(i) = find(c == i);
i = i + 1;
end
P = W2;
R = P(:,:,1); % Extract r-layer pixel of plaintext image G = P(:,:,2); % extract plaintext image G layer pixel B = P(:,:,3); % Extract b-layer pixel figure of plaintext image (1)
subplot(2.2.1); imshow(R,[]); title('R layer of first encryption'); imwrite(R,'R1.tif')
subplot(2.2.2); imshow(G,[]); title('Layer G of the first encryption'); imwrite(G,'G1.tif')
subplot(2.2.3); imshow(B,[]); title('Layer B of the first encryption'); imwrite(B,'B1.tif')
subplot(2.2.4); imshow(P,[]); title('First encrypted RGB color layer'); imwrite(P,'First encrypted RGB color layer. Tif'%%%%% [M,N]=size(R); % Using Logistic chaotic mapping, sequential encryption of r-layered image u=3.9;
x0=0.5;
x=x0;
for i=1:100% iteration100X =u*x*(1-x);
end
R1=zeros(1,M*N); % generate one dimensional chaotic encryption sequence R1(1)=x;
for i=1:M*N- 1
R1(i+1)=u*R1(i)*(1-R1(i));
end
R2=uint8(255*R1); % Normalized sequence R3= 0 (R2,M,N); % to two-dimensional chaotic encryption sequence R4=bitxor(R,R3); % xOR operation encrypted imwrite(R4,'R2.tif') % [M,N]=size(G); % Logistic chaotic mapping is used to encrypt sequences of G-layered images u=3.9;
x0=0.5;
x=x0;
for i=1:100% iteration100X =u*x*(1-x);
end
G1=zeros(1,M*N); % produces a one-dimensional chaotic encryption sequence G1(1)=x;
for i=1:M*N- 1
G1(i+1)=u*G1(i)*(1-G1(i));
end
G2=uint8(255*G1); % normalized sequence G3= 0 (G2,M,N); % is converted to 2d chaotic encryption sequence G4= Bitxor (G,G3); % xOR operation encrypted imwrite(G4,'G2.tif') % [M,N]=size(B); % Using Logistic chaotic mapping, sequential encryption u= for B layered image3.9;
x0=0.5;
x=x0;
for i=1:100% iteration100X =u*x*(1-x);
end
B1=zeros(1,M*N); % generate one dimensional chaotic encryption sequence B1(1)=x;
for i=1:M*N- 1
B1(i+1)=u*B1(i)*(1-B1(i));
end
B2=uint8(255*B1); % Normalized sequence B3= 0 (B2,M,N); % is converted to 2d chaotic encryption sequence B4= Bitxor (B,B3); % xOR operation encrypted imwrite(B4,'B2.tif') %RGB triple synthesis P1=cat(3,R4,G4,B4);
figure(2);
subplot(2.2.1); imshow(R4); title('Image after second R layer encryption');
subplot(2.2.2); imshow(G4); title('Image after second G layer encryption');
subplot(2.2.3); imshow(B4); title('Image after second layer B encryption');
subplot(2.2.4); imshow(P1); title('Encrypting color RGB images for the second time');
imwrite(P1,'Second encrypted color RGB image.tif') % % % % % % % % % % % % % % % % % % % % % % % % % % the cipher image embedded into the carrier image % % % % % % % % % % % % % % % % % % % % reads the image F = imread ('houlian.tif');
Rf = F(:,:,1); % Extract R layer pixel of carrier image Gf = F(:,:,2); % Extract G layer pixel of carrier image Bf = F(:,:,3); % The carrier takes the B layer pixel figure of the image (3);
subplot(2.2.1); imshow(Rf); title('Carrier image R layer');
subplot(2.2.2); imshow(Gf); title('Carrier image G layer');
subplot(2.2.3); imshow(Bf); title('Carrier image B layer');
subplot(2.2.4); imshow(F); title('Carrier image RGB Color Layer'); % Divide the pixel values of R4,G4 and B4 into two parts: the decimal place and the tens place10); RCD=floor(R4./10);
GCV=mod(G4,10); GCD=floor(G4./10);
BCV=mod(B4,10); BCD=floor(B4./10); The carrier image is decomposed by layered wavelet and embedded in WAVe_in ='db1'; [Rll,Rlh,Rhl,Rhh]=dwt2(Rf,wave_in); mv=mean(Rll(:)); % Find the mean value of the matrix Rllfor i=1:floor(M)
for j=1:floor(N)
if(Rll(i,j)>=mv)
Rlh(i,j)=RCV(i,j);
Rhl(i,j)=RCD(i,j);
elseRlh(i,j)=RCD(i,j); Rhl(i,j)=RCV(i,j); end end end [Gll,Glh,Ghl,Ghh]=dwt2(Gf,wave_in); mv=mean(Gll(:)); % Find the mean value of matrix Gllfor i=1:floor(M)
for j=1:floor(N)
if(Gll(i,j)>=mv)
Glh(i,j)=GCV(i,j);
Ghl(i,j)=GCD(i,j);
elseGlh(i,j)=GCD(i,j); Ghl(i,j)=GCV(i,j); end end end [Bll,Blh,Bhl,Bhh]=dwt2(Bf,wave_in); mv=mean(Bll(:)); % Find the mean value of the matrix Bllfor i=1:floor(M)
for j=1:floor(N)
if(Bll(i,j)>=mv)
Blh(i,j)=BCV(i,j);
Bhl(i,j)=BCD(i,j);
elseBlh(i,j)=BCD(i,j); Bhl(i,j)=BCV(i,j); The inverse wavelet transform (IDWT) is used to obtain the image FRGB Fr= IDWT2 (Rll,Rlh,Rhl,Rhh, WAVe_in) on visual security; Fg=idwt2(Gll,Glh,Ghl,Ghh,wave_in); Fb=idwt2(Bll,Blh,Bhl,Bhh,wave_in); Frgb(:,:,1)=Fr; % % synthetic Frgb (:, :,2)=Fg; % % synthetic Frgb (:, :,3)=Fb; Synthetic Frgb % % = uint8 (Frgb); figure(4);
subplot(2.2.1); imshow(Fr,[]); title('Dense layer R');
subplot(2.2.2); imshow(Fg,[]); title('Dense layer G');
subplot(2.2.3); imshow(Fb,[]); title('Load density B layer');
subplot(2.2.4); imshow(uint8(Frgb),[]); title('Visual Security Image');
imwrite(Frgb,'Visual safety image.tif') % % % % % % % % % % % % % % % % % % % % % % % % % % from the vision of plaintext cipher security cipher image extracted % % % % % % % % % % % % % % % % % % % C = Frgb; % close all; % close all; Cr=C(:,:,1);
Cg=C(:,:,2);
Cb=C(:,:,3); [Rll1,Rlh1,Rhl1,Rhh1]=dwt2(Cr,wave_in); mv=median(Rll1(:)); RD1=zeros(M,N); RD2=zeros(M,N); % defines two matrices for the decimal place and the tens placefor i=1:floor(M)
for j=1:floor(N)
if(Rll1(i,j)>=mv)
RD1(i,j)=Rlh1(i,j);
RD2(i,j)=Rhl1(i,j);
else
RD2(i,j)=Rlh1(i,j);
RD1(i,j)=Rhl1(i,j);
end
end
end
Copy the code
Third, the operation result
Fourth, note
Version: 2014 a