-
大小: 195KB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-05-22
- 語言: Matlab
- 標(biāo)簽:
資源簡介
各種數(shù)字水印的matlab源代碼,有DFT,DCT,小波變換等,希望能幫到還在為數(shù)字水印頭疼的童鞋一點(diǎn)幫助

代碼片段和文件信息
%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??各種數(shù)字水印的matlab源代碼\cdma_em
?????文件???????1731??2002-05-30?23:46??各種數(shù)字水印的matlab源代碼\cdma_recover.m
?????文件???????2874??2002-05-31?03:37??各種數(shù)字水印的matlab源代碼\cor_em
?????文件???????3248??2002-05-31?04:20??各種數(shù)字水印的matlab源代碼\cor_em
?????文件???????2320??2002-05-31?03:23??各種數(shù)字水印的matlab源代碼\cor_recover.m
?????文件???????2597??2002-05-30?23:48??各種數(shù)字水印的matlab源代碼\cor_recover_mod.m
?????文件???????3503??2002-05-31?13:01??各種數(shù)字水印的matlab源代碼\dct1_em
?????文件???????1716??2002-05-31?13:00??各種數(shù)字水印的matlab源代碼\dct1_recover.m
?????文件???????3287??2002-05-31?12:59??各種數(shù)字水印的matlab源代碼\dct2_em
?????文件???????4133??2002-05-31?13:33??各種數(shù)字水印的matlab源代碼\dct2_em
?????文件???????2687??2002-05-31?12:59??各種數(shù)字水印的matlab源代碼\dct2_recover.m
?????文件???????3165??2002-05-31?13:52??各種數(shù)字水印的matlab源代碼\dct2_recover_mod.m
?????文件???????1819??2002-05-31?15:56??各種數(shù)字水印的matlab源代碼\dwt_em
?????文件???????1716??2002-05-31?15:57??各種數(shù)字水印的matlab源代碼\dwt_recover.m
?????文件???????1510??2002-05-31?02:00??各種數(shù)字水印的matlab源代碼\lsb_em
?????文件????????926??2002-05-30?23:48??各種數(shù)字水印的matlab源代碼\lsb_recover.m
?????文件???????1034??2002-05-27?11:41??各種數(shù)字水印的matlab源代碼\pn_period.m
?????文件????????579??2002-05-28?14:15??各種數(shù)字水印的matlab源代碼\pn_test.m
?????文件????????727??2002-05-31?15:38??各種數(shù)字水印的matlab源代碼\psnr.m
?????文件?????????52??2008-10-15?14:37??各種數(shù)字水印的matlab源代碼\readme.txt
?????文件???????2120??2002-05-25?19:28??各種數(shù)字水印的matlab源代碼\_copyright.bmp
?????文件?????263222??2002-05-30?02:04??各種數(shù)字水印的matlab源代碼\_copyright_large.bmp
?????文件???????1188??2002-05-25?21:10??各種數(shù)字水印的matlab源代碼\_copyright_small.bmp
?????文件???????1220??2002-05-25?14:48??各種數(shù)字水印的matlab源代碼\_key.bmp
?????文件?????263224??2002-05-25?12:42??各種數(shù)字水印的matlab源代碼\_lena_std_bw.bmp
?????文件???????1847??2011-05-05?21:24??各種數(shù)字水印的matlab源代碼\dct2_em
????..A.SH.?????19968??2011-05-09?14:50??各種數(shù)字水印的matlab源代碼\Thumbs.db
?????目錄??????????0??2008-10-15?14:37??各種數(shù)字水印的matlab源代碼
-----------?---------??----------?-----??----
???????????????594087????????????????????28
............此處省略1個文件信息
評論
共有 條評論