www.pudn.com > watermarking-with-Hus-moments.rar > water.m, change:2015-06-27,size:715b


function   water( s2,c,f) 
%UNTITLED2 Summary of this function goes here 
%   Detailed explanation goes here 
m=cat(1,s2,s2,s2,s2,s2,s2,s2,s2,s2); 
n=cat(2,m,m); 
imshow(n) 
message = input('type your text: ','s'); 
L = length(message); 
u = zeros(1,L); 
 f(200,200) = L; 
for i=1:L 
    u(i) = abs(message(i)); 
end 
if(L<=80) 
  for i=1:L 
        for j=1:8 
         k=bitget(u(i),j); 
         p=bitget(n(i,j),1); 
        g= bitxor(k,p); 
       if g == 0 
         f(c(4)+i,j)= bitset(f(c(4)+i,j),1,0); 
       else  
             f(c(4)+i,j)= bitset(f(c(4)+i,j),1,1); 
       end 
        end 
  end 
            else 
    disp('tol matn bozorg ast');   
end 
 
imshow(f) 
imwrite(f,'picc.bmp'); 
end