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.

StudyDCResults.m
clear all 
% scaling=90;
% bias=0.0004;

Im0_2 = imread('french-4.tif');
Im_wm=imread(['french-4-wm.tif']);%'french-4-wm.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);
%wm_extracted=zeros(1,length);

k=1;
blkrows = 1:8;
blkcols = blkrows;

numDCincrease=0;
numDCdecrease=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);

          blk_wm=Im_wm(i*8+blkrows, j*8+blkcols);
          blkdct_wm= dct2(blk_wm);
          if(blkdct_wm(1,1)>blkdct0(1,1))
              numDCincrease=numDCincrease+1;
          end
          if(blkdct_wm(1,1)<blkdct0(1,1))
              numDCdecrease=numDCdecrease+1;
          end
          k=k+1;
    end
  end
end

disp(['numDCdecrease is ',num2str(numDCdecrease),', percentage of decrease is ',num2str(numDCdecrease/length)]);
disp(['numDCincrease is ',num2str(numDCincrease),', percentage of increase is ',num2str(numDCincrease/length)]);


Contact us