?? vardermen5yue2.m
字號:
clear all;
Ximage=double(imread('C:\Documents and Settings\xdjsj\My Documents\zyh\program\Lena.jpg'));
Yimage=double(imread('C:\Documents and Settings\xdjsj\My Documents\zyh\program\Monkey.jpg'));
Zimage=double(imread('C:\Documents and Settings\xdjsj\My Documents\zyh\program\house.jpg'));
Ih=size(Ximage,1);%圖像的長度
Iw=size(Ximage,2);%圖像的寬度
Image=double(zeros(size(Ximage)));
Image=Zimage;
Dimage=Image;
X1image=Ximage;
Y1image=Yimage;
ZHimage=double(zeros(size(Ximage)));
Arnold=double(zeros(size(Ximage)));
s=1;
renewing=0;
hiding=0;
% 隱 藏
% key1=4.0;
key2=0.1;
for(t=1:s)
figure(t)
subplot(3,2,1)
imshow(Ximage,[]);;%顯示圖像
title('待隱藏圖像1');
for(i=1:Ih)
for(j=1:Iw)
Arnold(i,j)=mod(j+i-1,256);
if(mod(j+i-1,256)==0)
Arnold(i,j)=256;
end
end
end
Ximage= Ximage*Arnold;
figure(t)
subplot(3,2,2)
imshow(Ximage,[]);
title('置亂圖像');
figure(t)
subplot(3,2,3)
imshow(Yimage,[]);
title('待隱藏圖像2');
Yimage= mod(Yimage*Arnold,256);
figure(t)
subplot(3,2,4)
imshow(Yimage,[]);
title('置亂圖像');
end
% 恢 復
Arnold1= inv(Arnold);
for(t=1:s)
Ximage=Ximage*Arnold1;
Yimage=mod(Yimage*Arnold1,256);
figure(t)
subplot(3,2,5)
imshow(Ximage,[]);
title('恢復圖像');
figure(t)
subplot(3,2,6)
imshow(Yimage,[]);
title('恢復圖像');
end
for(i=1:Ih)
for(j=1:Iw)
% if(Image(i,j)~=Ximage(i,j))
renewing=renewing+(X1image(i,j)-Ximage(i,j))^2;
% end
end
end
renewing=renewing/(Ih*Iw);
renewing=renewing^(1/2);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -