• 大小: 195KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-22
  • 语言: Matlab
  • 标签:

资源简介

各种数字水印的matlab源代码,有DFT,DCT,小波变换等,希望能帮到还在为数字水印头疼的童鞋一点帮助

资源截图

代码片段和文件信息

%Name:		Chris Shoemaker
%Course: EER-280 - Digital Watermarking
%Project:  CDMA based using multiple PN sequences embeded into whole object
%           Watermark embeding

clear all;

% save start time
start_time=cputime;

k=2;                % set the gain factor for embeding

% read in the cover object
file_name=‘_lena_std_bw.bmp‘;
cover_object=double(imread(file_name));

% determine size of watermarked image
Mc=size(cover_object1); %Height
Nc=size(cover_object2); %Width

% read in the message image and reshape it into a vector
file_name=‘_copyright_small.bmp‘;
message=double(imread(file_name));
Mm=size(message1);                         %Height
Nm=size(message2);                         %Width
message_vector=round(reshape(messageMm*Nm1)./256);

% 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‘key);

watermarked_image=cover_object;

% when message contains a ‘0‘ add pn sequence with gain k to cover image
for kk=1:length(message_vector)
    pn_sequence=round(2*(rand(McNc)-0.5));
    
    if message(kk) == 0
        watermarked_image=watermarked_image+k*pn_sequence;
    end
end

% convert back to uint8
watermarked_image_uint8=uint8(watermarked_image);

% write watermarked Image to file
imwrite(watermarked_image_uint8‘cdma_watermarked.bmp‘‘bmp‘);

% display processing time
elapsed_time=cputime-start_time

% calculate the PSNR
psnr=psnr(cover_objectwatermarked_image_uint8McNc)

% display watermarked Image
figure(1)
imshow(watermarked_image_uint8[])
title(‘Watermarked Image‘)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1674  2002-05-31 04:26  各种数字水印的matlab源代码\cdma_embed.m

     文件       1731  2002-05-30 23:46  各种数字水印的matlab源代码\cdma_recover.m

     文件       2874  2002-05-31 03:37  各种数字水印的matlab源代码\cor_embed.m

     文件       3248  2002-05-31 04:20  各种数字水印的matlab源代码\cor_embed_mod.m

     文件       2320  2002-05-31 03:23  各种数字水印的matlab源代码\cor_recover.m

     文件       2597  2002-05-30 23:48  各种数字水印的matlab源代码\cor_recover_mod.m

     文件       3503  2002-05-31 13:01  各种数字水印的matlab源代码\dct1_embed.m

     文件       1716  2002-05-31 13:00  各种数字水印的matlab源代码\dct1_recover.m

     文件       3287  2002-05-31 12:59  各种数字水印的matlab源代码\dct2_embed.m

     文件       4133  2002-05-31 13:33  各种数字水印的matlab源代码\dct2_embed_mod.m

     文件       2687  2002-05-31 12:59  各种数字水印的matlab源代码\dct2_recover.m

     文件       3165  2002-05-31 13:52  各种数字水印的matlab源代码\dct2_recover_mod.m

     文件       1819  2002-05-31 15:56  各种数字水印的matlab源代码\dwt_embed.m

     文件       1716  2002-05-31 15:57  各种数字水印的matlab源代码\dwt_recover.m

     文件       1510  2002-05-31 02:00  各种数字水印的matlab源代码\lsb_embed.m

     文件        926  2002-05-30 23:48  各种数字水印的matlab源代码\lsb_recover.m

     文件       1034  2002-05-27 11:41  各种数字水印的matlab源代码\pn_period.m

     文件        579  2002-05-28 14:15  各种数字水印的matlab源代码\pn_test.m

     文件        727  2002-05-31 15:38  各种数字水印的matlab源代码\psnr.m

     文件         52  2008-10-15 14:37  各种数字水印的matlab源代码\readme.txt

     文件       2120  2002-05-25 19:28  各种数字水印的matlab源代码\_copyright.bmp

     文件     263222  2002-05-30 02:04  各种数字水印的matlab源代码\_copyright_large.bmp

     文件       1188  2002-05-25 21:10  各种数字水印的matlab源代码\_copyright_small.bmp

     文件       1220  2002-05-25 14:48  各种数字水印的matlab源代码\_key.bmp

     文件     263224  2002-05-25 12:42  各种数字水印的matlab源代码\_lena_std_bw.bmp

     文件       1847  2011-05-05 21:24  各种数字水印的matlab源代码\dct2_embed.asv

    ..A.SH.     19968  2011-05-09 14:50  各种数字水印的matlab源代码\Thumbs.db

     目录          0  2008-10-15 14:37  各种数字水印的matlab源代码

----------- ---------  ---------- -----  ----

               594087                    28

............此处省略1个文件信息

评论

共有 条评论