www.pudn.com > Arnold.rar > tiqu.m, change:2014-07-11,size:467b


%提取水印 
function m=tiqu(w,n,x) 
%(1)将图像置乱 
w1=arnold(w,n); 
%(2)计算水印嵌入的位置 
y=zeros(64,64) 
y(1)=mod(x,4); 
for i=2:64*64 
    y(i)=mod(y(i-1)+n,4); 
end 
%(3)在相应位置提取水印 
mc=zeros(64,64) 
k=1; 
for i=x:x+64-1 
    for j=x:x+64-1 
        mc(i-x+1,j-x+1)=bitget(w1(i,j),y(k)+3); 
        k=k+1; 
    end 
end 
m=mc; 
%(4)逆变换,恢复水印 
m=iarnold1(mc,n); 
% n1=zhouqi(mc); 
% m=iarnold(mc,n,n1); 
%(5)显示水印 
%figure;imshow(m,[]);