1 简介
文章对DCT(离散余弦变换)域图像数字水印算法进行了研究,并用matlab实验工具,结果表明,该算法使水印的嵌入达到了好的鲁棒性和不可见性.做原始信号DCT的算法:Cox和Piva等人提出的DCT经典的技术作品。Cox使用随机数发生器生成标准的正态序列作为水印信息DCT变换后,选择去除DC水印信息叠加在系数以外的低频系数中;Piva修改整个图像的中频部分。分块原始信号后,再做DCT的算法:Hsu和Wu把图像进行8*8将二进制序列作为水印分块DCT中频区;一些学者计算整个图像DCT,嵌入实数序列DCT中频系数。选择中频区域的优点是尽量减少嵌入式信息对图像主观视觉的影响尽量避免压缩对水印信息造成的损失。
2 部分代码
clear,clc
%{
%------------------------------------------------------------------
%加入水印
%------------------------------------------------------------------
Watermarking='./Test picture/test_1.jpg';
WM=imread(Watermarking); %水印图像
figure,imshow(WM),title('Watermarking');
%-----------------------------------------------
Image_name ='./Test picture/test_2.jpg';
IM=imread(Image_name); %原始载体
figure,imshow(IM),title('Original drawing');
%-----------------------------------------------
Add_Watermarking(Watermarking,Image_name); %添加水印
%-----------------------------------------------
At_Watermarking_picture='./Watermarking picture/At Watermarking picture.png';
AWM=imread(At_Watermarking_picture); 添加水印后的图片%
figure,imshow(AWM),title('After watermarking picture');
%------------------------------------------------------------------
%加密
%------------------------------------------------------------------
Modulation_Key=0.362000000001; %加密密钥
Image_name='./Watermarking picture/At Watermarking picture.png';
W_encryption_picture=imread(Image_name); %加密图像
figure,imshow(W_encryption_picture),title('Before the encryption');
%-----------------------------------------------
Image_Encryption(Modulation_Key,Image_name); %混沌加密函数
%-----------------------------------------------
encryption_picture='./Encryption picture/encryption picture.png';
image_encryption=imread(encryption_picture); %加密后的图像
figure,imshow(image_encryption),title('After encrypted');
%------------------------------------------------------------------
%解密
%------------------------------------------------------------------
Modulation_Key; %解密密钥
Image_name='./Encryption picture/encryption picture.png';
image_encryption=imread(Image_name); %加密图像
figure,imshow(image_encryption),title('Before the decryption');
%-----------------------------------------------
Image_Decryption(Modulation_Key,Image_name) %解密函数
%-----------------------------------------------
decryption_picture='./Decryption picture/decryption picture.png';
image_Decryption=imread(decryption_picture); 解密图像%
figure,imshow(image_Decryption),title('After decrypted');
%}
%------------------------------------------------------------------
%提取水印
%------------------------------------------------------------------
Image_name='./Decryption picture/decryption picture.png';
A_Watermarking_Picture=imread(Image_name); 提取水印前的图像
figure,imshow(A_Watermarking_Picture),title('Before extract Watermarking');
%-----------------------------------------------
Extract_Watermarking(Image_name)
%-----------------------------------------------
Watermarking_picture='./Watermarking picture/Watermarking picture.png';
A_Watermarking_Picture=imread(Watermarking_picture); %提取水印图像
figure,imshow(A_Watermarking_Picture),title('Watermarked image');
%------------------------------------------------------------------
3 仿真结果
4 参考文献
[1]吴和静, 闵昆龙, 刘芳,等. 基于DCT图像数字水印算法及域域matlab实现[J]. 中国科技信息, 2014(9):2.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等领域Matlab仿真,相关matlab私信可以交换代码问题。
如些理论引用网络文献,如有侵权联系博主删除。