www.pudn.com > watermarking-with-Hus-moments.rar > decod.m, change:2015-06-28,size:1083b


clc; 
clear all; 
[filename,pathname]=uigetfile('*','select file'); 
f=imread([pathname,filename]); 
type=f(100,200); 
if (type==2) 
f=flipdim(f,2); 
end 
if (type==3) 
f=imrotate(f,-90,'bilinear'); 
end 
L=f(200,200) ; 
F=ipl_find_circle(f);%bedast ovardan bozorgtarin daire tasvir 
h=phiforregin(F); 
 
c=zeros(1,7); 
maxh=max(h);minh=min(h);  
for i=1:7 
    c(i)=floor(((h(i)-minh)/(maxh-minh))*400); 
     
end 
H=zeros(7,7); 
for i=1:7 
    H1 = phiforregin((calcir(f,c(i)))); 
    H(i,:)=H1; 
end 
 
C=bitget(h,1); 
S=bitget(H,1); 
s2=zeros(7,7); 
for i=1:7 
s2(i,:)=bitxor(C,S(i,:)); 
end 
m=cat(1,s2,s2,s2,s2,s2,s2,s2,s2,s2); 
n=cat(2,m,m); 
u = zeros(1,L); 
if(L<=80) 
for i=1:L 
   for j=1:8 
       v = bitget(f(c(4)+i,j),1); 
       if (v == 1) 
           if(n(i,j)==1) 
           u(i) = bitset(u(i),j,0); 
       else 
           u(i) = bitset(u(i),j,1); 
           end 
       elseif(n(i,j)==1) 
           u(i) = bitset(u(i),j,1); 
       else 
           u(i) = bitset(u(i),j,0); 
       end 
        
   end 
end 
 
else 
   disp('error');   
end 
disp(char(u));