Code covered by the BSD License  

Highlights from
Binary Image Watermarking/Data Hiding: Data, Algorithms, and Distortion Measure

Binary Image Watermarking/Data Hiding: Data, Algorithms, and Distortion Measure

by

 

26 Apr 2012 (Updated )

A package on binary image watermarking/data hiding, including data, algorithms & distortion measure.

VerifyPGreater.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%function encode_t1(scaling,bias) %Embedding(winsize,sigma,scaling,bias)
clear all
scaling=90;
bias=0.0004;
Im0_2 = imread('french-4.tif');
[Rows,Cols]=size(Im0_2);
RowsNum=64;%512/8
ColsNum=64;
h = fspecial('gaussian',5,1);
FImg=filter2(h,Im0_2);
length=mark_length(Im0_2,8,RowsNum,ColsNum,1);
disp(['There are ',num2str(length), ' non-uniform blocks out of ',num2str(RowsNum*ColsNum)]);
%wm=randn(1,length);
load wm
I_wm=Im0_2;
k=1;
blkrows = 1:8;
blkcols = blkrows;

countVeri=0;
countTotal=0;
for i=0:(RowsNum-1)
   for j=0:(ColsNum-1)
      blk0_2=Im0_2(i*8+blkrows, j*8+blkcols);
      if max(max(blk0_2))~=min(min(blk0_2))
          blk0=FImg(i*8+blkrows, j*8+blkcols);      
          blkdct0= dct2(blk0);
          blkmax=max(max(blk0));
          blkmin=min(min(blk0));
          T_mid_k_p=(blkmin+blkmax)*(0.5);
          CW_k_w_k=wm(k)*scaling*blkdct0(1,1)/8;
          if (abs(CW_k_w_k)>abs(T_mid_k_p))
              countVeri=countVeri+1;
          end
          k=k+1;
          countTotal=countTotal+1;
       end
   end
end


disp(['CountVeri = ',num2str(countVeri)]);
disp(['CountTotal = ',num2str(countTotal)]);
disp(['Percentage = ',num2str(countVeri/countTotal)]);

Contact us