A list,

The design and application of image encryption algorithm based on chaotic system

Part of the source code

clear all; t0 = clock; % test program run time im=imread('elain.jpg'); im1=rgb2gray(im); % image gray-scale im1= medFilt2 (im1,[3 3]); % image smoothing subplot(331);
figure(1); imshow(im); %X is the original image title('Original image');
figure(2);
imshow(im1);
title('Graying');
im1=double(im1);
[ca1,ch1,cv1,cd1]=dwt2(im1,'bior3.7'); % wavelet transform to obtain the low frequency and high frequency coefficients of the image3);
subplot(231);
imshow(ca1,[]);
title('Image approximation');
subplot(232);
imshow(ch1);
title('Low frequency horizontal component');
subplot(233);
imshow(cv1);
title('Low frequency vertical component');
subplot(234);
imshow(cd1),;
title('High frequency component'); [M,N]=size(CA1); [M,N]=size(CA1); e=hundungen555(M,N,0.1);
tt=0.1;
fca1=mod(tt*ca1+(1-tt)*e,256);
subplot(235);
imshow(fca1,[]);
title('encrypt');
im2=idwt2(ca1,ch1,cv1,cd1,'bior3.7');
figure(4);
imshow(uint8(im2),[]);
title('Gray image Wavelet Reconstruction');
im3=idwt2(fca1,ch1,cv1,cd1,'bior3.7');
figure(5);
imshow(uint8(im3),[]);
title('Wavelet Reconstruction of Encrypted images'); Function e=hundungen(M,N,key0) KEY0 =hundungen(M,N,key0)3.925*key0*(1-key0);
end
key1=3.925;
for(i=1:M)
    for(j=1:N)
       key0=key1*key0*(1-key0);
       a(i,j)=key0;
    end
end
key3=0.2;
key2=3.925;
for(i=1:M)
    for(j=1:N)
        key3=key2*key3*(1-key3);
        b(i,j)=key3;
    end
end
key4=0.3;
key2=3.925;
for(i=1:M)
    for(j=1:N)
        key4=key2*key4*(1-key4);
        c(i,j)=key4;
    end
end
t=0.4;
w0=0.2;
w1=0.5;
w2=0.3;
w=(1-t)^2*w0+2*t*(1-t)*w1+t^2*w2;
for(i=1:M)
   for(j=1:N)  
        P(i,j)=(1-t)^2*a(i,j)*w0+2*t*(1-t)*b(i,j)*w1+t^2*c(i,j)*w2;
   d(i,j)=P(i,j)/w;
   d(i,j)=P(i,j);
    end
end
x=d;

end

Copy the code

Third, the operation result

Iv. Matlab version and references

1 Matlab version 2014A

2 References [1] CAI Limei. MATLAB Image Processing — Theory, Algorithm and Case Analysis [M]. Tsinghua University Press, 2020. [2] Yang Dan, ZHAO Haibin, LONG Zhe. Detailed Analysis of MATLAB Image Processing Examples [M]. Tsinghua University Press, 2013. [3] Zhou Pin. MATLAB Image Processing and Graphic User Interface Design [M]. Tsinghua University Press, 2013. [4] LIU Chenglong. Proficient in MATLAB image processing [M]. Tsinghua University Press, 2015.