1.通过应用DCT将图像带入频域
2.生成水印信号
3.利用原图最大的一千个系数嵌入长度为1000的水印序列。
4.系数根据消息的流位使用以下等式进行修改,
|CAW = CA (1 + α Wi)|
5.提取过程——简单地从加水印的图像系数中减去原始的DCT系数
function WM_plot(r,c,ext_wm,orig_wm)
for k=1:1000
wm=randn(r,c);%depending on the size of the watermark
wm=uint8(wm);%if necessary
store(k)=WM_detect(ext_wm,wm);%wrong watermarks
if k == 400
store(k)=WM_detect(ext_wm,orig_wm);%original watermark detection
end
end
figure(1),plot(1:k,[store]),ylabel('Watermark detector response'),xlabel('random watermarks');
hold on
%threshold calculation
[peak,ind]=sort(store,'descend');
threshold=peak(2)+(peak(2)*0.1);%T=second highest peak+10percentof the same
figure(1),plot(1:1000,[threshold],'red');
hold on
figure(1),plot(1:1000,peak(2),'green');