【图像隐写】基于matlab GUI DWT+SVD数字水印 【含Matlab源码 939期】
【摘要】
一、DWT+SVD数字水印简介
理论知识参考文献:基于DWT和SVD的彩色图像数字水印算法研究 一种基于DWT-SVD的图像数字水印算法
二、部分源代码
function varargout = m...
一、DWT+SVD数字水印简介
理论知识参考文献:基于DWT和SVD的彩色图像数字水印算法研究
一种基于DWT-SVD的图像数字水印算法
二、部分源代码
function varargout = main(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @main_OpeningFcn, ...
'gui_OutputFcn', @main_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
function main_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = main_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function axes1_ButtonDownFcn(hObject, eventdata, handles)
function popupmenu1_CreateFcn(hObject, eventdata, handles)
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function pushbutton1_Callback(hObject, eventdata, handles)
f1=uigetfile('*.bmp','打开载体图像');
guidata(hObject, handles);
global cover_object;
cover_object=imread(f1);
axes(handles.axes1);
imshow(cover_object);
title('载体图像');
function pushbutton3_Callback(hObject, eventdata, handles)
f2=uigetfile('*.jpg','打开原始水印图像');
guidata(hObject, handles);
global watermark;
watermark=imread(f2);
watermark=im2bw(watermark);
axes(handles.axes4);
imshow(watermark);
title('水印图像');
function pushbutton2_Callback(hObject, eventdata, handles)
global watermark;
global watermark_en;
Mm=size(watermark,1);
Nm=size(watermark,2);
N=Mm*Nm;
key=0.2345;
m(1)=key;
for i=1:N-1
m(i+1)=4*m(i)-4*m(i)^2;
end
m=mod(1000*m,256);
m=uint8(m);m=im2bw(m);
n=1;
for i=1:Mm
for j=1:Nm
watermark_en(i,j)=bitxor(m(n),watermark(i,j));
n=n+1;
end
end
axes(handles.axes6);
imshow(watermark_en);
title('加密水印');
global watermark_en;
function pushbutton4_Callback(hObject, eventdata, handles)
global cover_object watermark_en CWI Temp;
[mm,nn]=size(cover_object);
[mm1,nn1]=size(watermark_en);
[LL HL LH HH]=dwt2(cover_object,'haar');
[U,S,V]=svd(LL);
af=0.03;
[lm,ln]=size(LL);
WW=zeros(lm,ln);
for i=1:mm1
for j=1:nn1
WW(i,j)=watermark_en(i,j);
end
end
Temp=S+af*WW;
[U1,S1,V1]=svd(Temp);
CW=U*S1*V';
I1=idwt2(CW,HL,LH,HH,'haar');
CWI=uint8(I1);
axes(handles.axes2);
imshow(CWI);
title('含水印信息的载体图像');
global CWI;
global Temp;
function pushbutton8_Callback(hObject, eventdata, handles)
global CWI;
global attackf;
f=CWI;
attackd=get(handles.popupmenu1,'Value');
while attackd~=0
switch attackd
case 1,
attackf=f;
att='未攻击';
break;
case 2,
f(20:180,20:180)=256;
attackf=f;
att='剪切图像';
break;
case 3,
attackf=imadjust(f,[],[0.4,1]);
att='图像增亮';
break;
case 4,
attackf=imadjust(f,[],[0,0.95]);
att='图像变暗';
break;
case 5,
- 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
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
三、运行结果
四、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/117355392
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)