%Blind embedding and linear correlation detection
clear all;
%Generate a reference pattern the same size as the images
wr=randn(112,92);
tm=mean2(wr);
wr=wr-tm;%zero mean
ts=std2(wr);
wr=wr/ts;%unit variance
%Show the reference pattern
figure
imshow(wr,[]);
%400 face images, 112 x 92 pixels, in 40 folders of 10 images each
numclass=40;
numface=10;
for s=1:numclass
for i=1:numface
%Read image
c0=double(imread(strcat('C:\facedb_bmp\s',num2str(s),'\',num2str(i),'.bmp')));
%Add reference pattern to the image to embed a 1
wa=double(c0+wr);
%Add negative reference pattern to the image to embed a 0
nwr=wr*-1;
nwa=double(c0+nwr);
%Calculate linear correlation for images carrying a 1, a 0,
%or no watermark and store it into a vector
corr1(10*(s-1)+i)=sum(sum(wa.*wr))/(112*92);
corr0(10*(s-1)+i)=sum(sum(nwa.*wr))/(112*92);
corrN(10*(s-1)+i)=sum(sum(c0.*wr))/(112*92);
end
end
%Calculate the histograms for the detection-value vectors
[a1,b1]=hist(corr1,-3:0.1:3);
[a2,b2]=hist(corr0,-3:0.1:3);
[a3,b3]=hist(corrN,-3:0.1:3);
%Plot the histograms
figure
plot(b2,a2/400*100,'red');
gtext('m=0');
hold;
plot(b3,a3/400*100,'green');
gtext('No watermark');
plot(b1,a1/400*100,'blue');
gtext('m=1');
xlabel('Detection value');
ylabel('Percentage of images');
random41.rar_random
版权申诉
178 浏览量
2022-07-15
18:11:15
上传
评论
收藏 1KB RAR 举报
寒泊
- 粉丝: 76
- 资源: 1万+
最新资源
- face-detect.ipynb
- 以下是一些关于ACM(国际大学生程序设计竞赛)、NOI(全国青少年信息学奥林匹克竞赛)以及CSP(全国青少年信息学奥林匹克竞赛提
- 是一些电子设计竞赛(电赛)经验分享,包括备赛策略、项目管理、团队合作和比赛期间的注意事项
- 全能运行库修复工具DirectX Repair v4.1.0.30770
- las格式点云数据使用详解(附VS编译好的LAStools工具)
- KRPano插件一键解密大师1.4.0 (解压密码1234)
- 适用于618节日的销售数据
- 《C++沉思录》是一本由 Scoot Meyers 所著的经典 C++ 编程书籍 该书深入探讨了 C++ 的一些高级概念和技术
- 海信刷机数据 LED42K310X3D(0000)BOM1-C006软件数据与LED42K310NX3D(0000)BOM1通用
- 网卡硬刷MAC地址的工具和教程
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈