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.

NonUniNum=CalNonUniNum(ImName)
function NonUniNum=CalNonUniNum(ImName)

img0=double(imread([ImName,'.png']));
[rows,cols]=size(img0);
img1=img0;
BlkSize=8;
AddCols=BlkSize-mod(cols,BlkSize);
AddRows=BlkSize-mod(rows,BlkSize);
MetriAddCols=ones(rows,AddCols);
MetriAddRows=ones(AddRows,(cols+AddCols));
img1=cat(2,img1,MetriAddCols);
img1=cat(1,img1,MetriAddRows);
[ComRow,ComCol]=size(img1);
RowNum=ComRow/BlkSize;
ColNum=ComCol/BlkSize;


NonUniNum=0;
RepeatIndex=1:BlkSize;
for m=1:RowNum
    for n=1:ColNum
        InterMetri=img1(((m-1)*BlkSize+RepeatIndex),((n-1)*BlkSize+RepeatIndex));
        if (mean(mean(InterMetri))~=1)&&(mean(mean(InterMetri))~=0)
            NonUniNum=NonUniNum+1;
        end
    end
end

Contact us