?? 1039049-
字號:
%-------------------- 添加高斯白噪聲----------------
%讀入偽裝圖像
M=imread('偽裝圖像.bmp');
figure(1)
subplot(121)
imshow(M)
title('第1位平面偽裝圖像')
%添加高斯噪聲
P1=imnoise(M,'gaussian',0.01);
subplot(122)
imshow(P1)
title('加高斯噪聲的偽裝圖像');
%------對高斯躁聲中值濾波-------
g=medfilt2(P1,[3,3]);
figure(2)
subplot(221)
imshow(g)
title('中值濾波后的高斯偽裝圖像');
%imwrite(uint8(g),'中值濾波圖像.bmp')
%Img_cover = double(imread('中值濾波圖像.bmp'));
%[nrow,ncol] = size(Img_cover);
%-------------------保存并讀入偽裝圖像---------------
imwrite(uint8(g),'高斯中值濾波圖像.bmp');
g=imread('高斯中值濾波圖像.bmp');
I_water=imread('sy.bmp');%讀入水印圖像
%-----------------------提取算法---------------------
M=8;
water_detect=zeros(nrow,ncol);
for i=1:nrow
for j=1:ncol
Img_bin=dec2bin(g(i,j),8);%把一個十進制數轉換成二進制數
if Img_bin(N)=='0'
water_detect(i,j)=0;
else
water_detect(i,j)=1;
end
end
end
%結果顯示
subplot(222);
imshow(I_water);%顯示原水印圖像
title('原水印圖像256*256')
subplot(223);
imshow(water_detect);
title('中值提取出的水印圖像256*256')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -