资源简介
本程序是首先对图像进行DWT变换,然后对细节子图进行DCT变换的一种数字水印方案
代码片段和文件信息
% embedding data through DWT technique
[filename pathname] = uigetfile(‘*.bmp‘ ‘Pick an M-file‘);
if isequal(filename0) || isequal(pathname0)
warndlg(‘Image is not selected‘);
else
a=imread(filename);
a=imresize(a[512512]);
imshow(a);
end
[filename pathname] = uigetfile(‘*.bmp‘ ‘Pick an M-file‘);
if isequal(filename0) || isequal(pathname0)
warndlg(‘Image is not selected‘);
else
secret=imread(filename);
imshow(secret);
end
[LL LH HL HH]=dwt2(a‘haar‘);
[LL1 LH1 HL1 HH1]=dwt2(HL‘haar‘);
cover_object=HL1;
[Mc Nc]=size(HL1);
k=50; % set gain factor for embeding
blocksize=4; % set the dct blocksize
midband=[ 0001; % defines the mid-band frequencies of an 8x8 dct
0011;
0111;
1110];
cover_object=double(HL1);
Mc=size(cover_object1); %Height
Nc=size(cover_object2); %Width
% determine maximum message size based on cover object and blocksize
max_message=Mc*Nc/(blocksize^2);
% read in the message image
message=double(secret);
Mm=size(message1); %Height
Nm=size(message2); %Width
% reshape the message to a vector
message=round(reshape(messageMm*Nm1)./256);
% check that the message isn‘t too large for cover
if (length(message) > max_message)
error(‘Message too large to fit in Cover object‘)
end
% pad the message out to the maximum message size with ones‘s
message_vector=ones(1max_message);
message_vector(1:length(message))=message;
% generate shell of watermarked image
watermarked_image=cover_object;
% read in key for PN generator
file_name=‘_key.bmp‘;
% key=double(imread(file_name))./256;
% reset MATLAB‘s PN generator to state “key“
rand(‘state‘35);
% generate PN sequence
pn_sequence_zero=round(2*(rand(1sum(sum(midband)))-0.5));
pn_sequence_one=round(2*(rand(1sum(sum(midband)))-0.5));
HLL=idwt2(LL1LH1watermarked_imageHH1‘haar‘);
watermarked_image_int=idwt2(LLLHHLLHH‘haar‘);
imwrite(uint8(watermarked_image_int)‘DwtdctHL2_watermarked.bmp‘‘bmp‘);
a=double(a);
psnr=psnr3(awatermarked_image_intNcMc)
imshow(watermarked_image_int[])
title(‘Watermarked Image‘)
% =========================================================================
% Retrieval through DWT technique\
% blocksize=4; % set the dct blocksize
%
% midband=[ 0001; % defines the mid-band frequencies of an 8x8 dct
% 0011;
% 0111;
% 1110];
%
% % read in the watermarked object
% file_name=‘DwtdctHL2_watermarked.bmp‘;
% watermarked_image2=double(imread(file_name));
% [LL LH HL HH]=dwt2(watermarked_image2‘haar‘);
% [LL1 LH1 HL1 HH1]=dwt2(HL‘haar‘);
% watermarked_image=HL1;
%
%
% % determine size of watermarked image
% Mw=size(watermarked_image1); %Height
% N
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1501334 2011-03-15 15:05 dct-dwt\Combined DWT-DCT Digital Image Watermarking.pdf
文件 3643 2011-03-15 15:05 dct-dwt\dw.asv
文件 3723 2011-03-15 15:05 dct-dwt\dw.m
文件 263222 2011-03-15 16:10 dct-dwt\DwtdctHL2_watermarked.bmp
文件 263222 2011-03-15 16:10 dct-dwt\Filtered.bmp
文件 15904 2011-03-15 15:15 dct-dwt\g.asv
文件 15950 2011-03-15 16:06 dct-dwt\g.m
文件 24304 2011-03-15 15:05 dct-dwt\guidemo.asv
文件 12938 2011-03-15 15:05 dct-dwt\guidemo.fig
文件 26953 2011-03-15 15:05 dct-dwt\guidemo.m
文件 2332672 2011-03-15 15:05 dct-dwt\Hidden Bits.doc
文件 6092 2011-03-15 15:19 dct-dwt\image water marking.m
文件 1220 2011-03-15 15:05 dct-dwt\key.bmp
文件 66614 2011-03-15 15:05 dct-dwt\lena.bmp
文件 795 2011-03-15 15:05 dct-dwt\psnr3.asv
文件 795 2011-03-15 15:05 dct-dwt\psnr3.m
文件 551 2011-03-15 15:05 dct-dwt\third.asv
文件 551 2011-03-15 15:05 dct-dwt\third.m
..A.SH. 59904 2011-04-15 15:44 dct-dwt\Thumbs.db
文件 2120 2011-03-15 15:05 dct-dwt\_copyright.bmp
文件 263222 2011-03-15 15:05 dct-dwt\_copyright_large.bmp
目录 0 2012-03-06 21:52 dct-dwt
----------- --------- ---------- ----- ----
4865729 22
- 上一篇:基于压缩感知的分布式视频编码框架matlab代码
- 下一篇:心电信号R波峰值检测算法
相关资源
- 基于行列像素置乱和DWT小波变换的图
- MATLAB数字水印dwt+dct+多攻击+GUI界面.
- 基于DCT的JPEG图像压缩
- 沙威老师构造正交小波变换矩阵的m
- 一个matlab上的图像压缩过程
- 基于DCT_变换的JPEG图像压缩及其MATLA
- 用matlab实现基于DCT域的鲁棒水印
- Matlab有关DCT域音频水印嵌入程序-317
- DCT_CS 稀疏矩阵
- DCT数字水印实现
- 数字水印嵌入与提取 DCT
- 基于matlab的DCT变换对灰度图像进行压
- 基于DWT和SVD结合的水印嵌入MATLAB代码
- 非抽取小波图像去噪
- 8x8点DCT变换matlab代码
- DWT盲水印嵌入和提取源代码
- 基于DWT的数字水印算法的MatLab实现
- DCT图像压缩Matlab
- 数字水印源代码
- DCT变换压缩
- MATLAB基于DCT图像压缩
- matlab实现JPEG
- DCT系数直方图
- 基于DCT变换的图像压缩算法
- DCT、DWT数字水印技术-matlab代码183640
- matlab实现基于DCT数字水印添加以及提
- DCT基函数图像_MATLAB版本
- 基于DCT变换的数字水印算法matlab代码
- 基于matlab的数字水印系统
- DCT水印算法实现MATLAB
评论
共有 条评论