【图像隐写】基于matlab DWT+IDWT数字水印嵌入+提取【含Matlab源码 1530期】
【摘要】
一、获取代码方式
获取代码方式1: 完整代码已上传我的资源: 【图像隐写】基于matlab DWT+IDWT数字水印嵌入+提取【含Matlab源码 1530期】
二、部分源代码
clc;
clear...
一、获取代码方式
获取代码方式1:
完整代码已上传我的资源: 【图像隐写】基于matlab DWT+IDWT数字水印嵌入+提取【含Matlab源码 1530期】
二、部分源代码
clc;
clear all;
warning off;
chos=0;
possibility=11;
while chos~=possibility,
chos=menu('Digital 3-level image watermarking','select the cover image','select the watermark image','show 3-level coverimage','show 3-level watermarkimage','show watermarked image','show extracted image','Calculate MSE for embedding','Calculate PSNR for embedding','Calculate MSE for extraction','Calculate PSNR for extraction','exit');
if chos==1
[fname pname]=uigetfile('*.jpg','select the Cover Image');
%eval('imageinput=imread(fname)');
imageinput=imread(fname);
A=rgb2gray(imageinput);
P1=im2double(A);
P=imresize(P1,[2048 2048]);
%imshow(P);
%figure(1);
%title('original image');
[F1,F2]= wfilters('haar', 'd');
[LL,LH,HL,HH] = dwt2(P,'haar','d');
[LL1,LH1,HL1,HH1] = dwt2(LL,'haar','d');
[LL2,LH2,HL2,HH2] = dwt2(LL1,'haar','d');
%figure(2)
%imshow(LL2,'DisplayRange',[]), title('3 level dwt of cover image');
end
if chos==2
[fname pname]=uigetfile('*.jpg','select the Watermark');
%eval('imageinput=imread(fname)');
%imageinput=imread(fname);
imw2=imread(fname);
imw=rgb2gray(imw2);
watermark=im2double(imw);
watermark=imresize(watermark,[2048 2048]);
%figure(3)
%imshow(uint8(watermark));title('watermark image')
[WF1,WF2]= wfilters('haar', 'd');
[L_L,L_H,H_L,H_H] = dwt2(watermark,'haar','d');
[L_L1,L_H1,H_L1,H_H1] = dwt2(L_L,'haar','d');
[L_L2,L_H2,H_L2,H_H2] = dwt2(L_L1,'haar','d');
%figure(4)
%imshow(L_L2,'DisplayRange',[]), title('3 level dwt of watermark image');
end
if chos==3
imshow(LL2,'DisplayRange',[]), title('3 level dwt of cover image')
end
if chos==4
imshow(L_L2,'DisplayRange',[]), title('3 level dwt of watermark image')
end
if chos==5
Watermarkedimage=LL2+0.0001*L_L2;
%computing level-1 idwt2
Watermarkedimage_level1= idwt2(Watermarkedimage,LH2,HL2,HH2,'haar');
%figure(5)
%imshow(Watermarkedimage_level1,'DisplayRange',[]), title('Watermarkedimage level1');
%computing level-2 idwt2
Watermarkedimage_level2=idwt2(Watermarkedimage_level1,LH1,HL1,HH1,'haar');
%figure(6)
%imshow(Watermarkedimage_level2,'DisplayRange',[]), title('Watermarkedimage level2');
%computing level-3 idwt2
Watermarkedimage_final=idwt2(Watermarkedimage_level2,LH,HL,HH,'haar');
%figure(7)
imshow(Watermarkedimage_final,'DisplayRange',[]), title('Watermarkedimage final')
end
if chos==6
[F11,F22]= wfilters('haar', 'd');
[a b c d]=dwt2(Watermarkedimage_final,'haar','d');
[aa bb cc dd]=dwt2(a,'haar','d');
[aaa bbb ccc ddd]=dwt2(aa,'haar','d');
function [ out ] = MSE( pic1,pic2 )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
e=0;
[m n]=size(pic1);
for i=1:m
for j=1:n
e=e+double((pic1(i,j)-pic2(i,j))^2);
end
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
三、运行结果
四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1] 蔡利梅.MATLAB图像处理——理论、算法与实例分析[M].清华大学出版社,2020.
[2]杨丹,赵海滨,龙哲.MATLAB图像处理实例详解[M].清华大学出版社,2013.
[3]周品.MATLAB图像处理与图形用户界面设计[M].清华大学出版社,2013.
[4]刘成龙.精通MATLAB图像处理[M].清华大学出版社,2015.
[5]梁欣.基于DWT和SVD的彩色图像数字水印算法研究[J].计算机与数字工程. 2019,47(08)
[6]张秀娟,朱春伟.一种基于DWT-SVD的图像数字水印算法[J].数字技术与应用. 2017,(10)
文章来源: qq912100926.blog.csdn.net,作者:海神之光,版权归原作者所有,如需转载,请联系作者。
原文链接:qq912100926.blog.csdn.net/article/details/121353876
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)