?? renyiqujian.m
字號:
clear all;
Ximage=double(imread('D:\work\Lena.jpg'));%待隱藏圖像
Yimage=double(imread('D:\work\cameraman.jpg'));%公開圖像
% Ih=size(Ximage,1);%圖像的長度
% Iw=size(Ximage,2);%圖像的寬度
Image=double(zeros(size(Ximage)));
Image=Ximage;
a=2;b=10;
t=1;
% 隱 藏
% key1=4;
key2=[3,4,5];
s=size(key2,2);
for(t=1:s)
figure(t)
subplot(2,2,1)
imshow(Image,[]);
title('待隱藏圖像');
figure(t)
subplot(2,2,2)
imshow(Yimage,[]);
title('模板圖像');
Image=(key2(t)-a)*Image/(b-a)+Yimage*(b-key2(t))/(b-a);
figure(t)
subplot(2,2,3)
imshow(Image,[]);
title('結果圖像');
Image=uint8(Image);
figure(t)
subplot(2,2,4)
imhist(Image);
title('結果圖像的直方圖');
Image=double(Image);
end
PSNRy=PSNR(Image,Yimage);
RMSEy=RMSE(Image,Yimage);
% 恢 復
for(t=1:s)
figure(t+s)
subplot(2,2,1)
imshow(Image,[]);
title('結果圖像');
figure(t+s)
subplot(2,2,2)
imshow(Yimage,[]);
title('模板圖像');
Image=(b-a)*Image/(key2(t)-a)-Yimage*(b-key2(t))/(key2(t)-a);
figure(t+s)
subplot(2,2,3)
imshow(Image,[]);
title('恢復圖像');
Image=uint8(Image);
figure(t+s)
subplot(2,2,4)
imhist(Image);
title('恢復圖像的直方圖');
Image=double(Image);
end
PSNRh=PSNR(Image,Ximage);
RMSEh=RMSE(Image,Ximage);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -