资源简介
基于matlab的水印篡改检测的仿真,建立了GUI界面,在matlab2014a版本下运行完全正确
代码片段和文件信息
function [wm]=exwmark(embimg)
% exwmark will extract the watermark which were
% embedded by the wtmark function
% embimg = embedded image
% wt = Extracted Watermark
[row clm]=size(embimg);
m=embimg;
%%%%%%%%%%%%%%%%% To divide image in to 4096---8X8 blocks %%%%%%%%%%%%%%%%%%
k=1; dr=0; dc=0;
% dr is to address 1:8 row every time for new block in x
% dc is to address 1:8 column every time for new block in x
% k is to change the no. of cell
for ii=1:8:row % To address row -- 8X8 blocks of image
for jj=1:8:clm % To address columns -- 8X8 blocks of image
for i=ii:(ii+7) % To address rows of blocks
dr=dr+1;
for j=jj:(jj+7) % To address columns of block
dc=dc+1;
z(drdc)=m(ij);
end
dc=0;
end
x{k}=z; k=k+1;
z=[]; dr=0;
end
end
nn=x;
%% Extract water mark %%
wm=[]; wm1=[]; k=1; wmwd=[]; wmwd1=[];
while(k<1025)
for i=1:32
kx=x{k}; % Extracting Blocks one by one
dkx=blkproc(kx[8 8]@dct2); % Applying Dct
nn{k}=dkx; % Save DCT values in new block to cross check
%% Change me for pixel location
wm1=[wm1 dkx(88)]; % Forming a row of 32 by 88 element
% Extracting water mark without dct
wmwd1=[wmwd1 kx(88)];
k=k+1;
end
wm=[wm;wm1]; wm1=[]; % Forming columns of 32x32
wmwd=[wmwd;wmwd1]; wmwd1=[];
end
for i=1:32
for j=1:32
diff=wm(ij);
if diff >=0
wm(ij)=0;
elseif diff < 0
wm(ij)=1;
end
end
end
wm=wm‘;
imwrite(wm‘wex.jpg‘)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 29338 2014-06-05 10:06 基于matlab的水印篡改检测的仿真\b.jpg
文件 1660 2019-03-08 12:32 基于matlab的水印篡改检测的仿真\exwmark.m
文件 89421 2019-03-07 00:15 基于matlab的水印篡改检测的仿真\main.fig
文件 8332 2019-03-08 12:28 基于matlab的水印篡改检测的仿真\main.m
文件 39472 2019-04-20 19:15 基于matlab的水印篡改检测的仿真\out.jpg
文件 780 2014-06-05 10:06 基于matlab的水印篡改检测的仿真\w.jpg
文件 1007 2019-04-20 19:14 基于matlab的水印篡改检测的仿真\wex.jpg
文件 2745 2019-03-08 12:31 基于matlab的水印篡改检测的仿真\wtmark.m
目录 0 2019-04-20 19:14 基于matlab的水印篡改检测的仿真
----------- --------- ---------- ----- ----
172755 9
评论
共有 条评论