Description: M=512 原图像长度
N=64
K=8
I=zeros(M,M)
J=zeros(N,N)
BLOCK=zeros(K,K)
显示原图像
I=imread( f:\ceshi\yuanshitu.bmp )
figure
imshow(I)
xlabel( 原始图像 )
显示水印图像
J=imread( f:\ceshi\logistic_nuaa64.bmp )
figure
imshow(J)
xlabel( 水印图像 )
嵌入水印
tem=1
for p=1:N
for q=1:N
x=(p-1)*K+1
y=(q-1)*K+1
BLOCK=I(x:x+K-1,y:y+K-1)
BLOCK=dct2(BLOCK)
if J(p,q)==0
a=-1
else
a=1
end
BLOCK(2,1)=BLOCK(2,1)*(1+a*0.01)
BLOCK=idct2(BLOCK)
I(x:x+K-1,y:y+K-1)=BLOCK
end
end
显示嵌入水印后的图像
figure
imshow(I)
xlabel( 嵌入水印后的图像 )
imwrite(I, f:\ceshi\embedded.bmp )
To Search:
- [rc] - Experimental purposes of this experiment
File list (Check if you may need any files):
dct.txt