function varargout = watermaked(varargin)
% WATERMAKED M-file for watermaked.fig
% WATERMAKED, by itself, creates a new WATERMAKED or raises the existing
% singleton*.
%
% H = WATERMAKED returns the handle to a new WATERMAKED or the handle to
% the existing singleton*.
%
% WATERMAKED('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in WATERMAKED.M with the given input arguments.
%
% WATERMAKED('Property','Value',...) creates a new WATERMAKED or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before watermaked_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to watermaked_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help watermaked
% Last Modified by GUIDE v2.5 26-May-2008 14:22:42
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @watermaked_OpeningFcn, ...
'gui_OutputFcn', @watermaked_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(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
% End initialization code - DO NOT EDIT
% --- Executes just before watermaked is made visible.
function watermaked_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to watermaked (see VARARGIN)
% Choose default command line output for watermaked
handles.output = hObject;
handles.contain=imread('nvlang512x512.jpg'); % 读入载体图
handles.name=imread('name32x32.bmp'); % 读入水印
handles.sel=0; % 不加攻击
handles.jpeg=0;
handles.gau=0;
handles.salt=0;
handles.ang=0;
handles.filt=0; % 不滤波
set(handles.edit3,'string',handles.jpeg); % 文本框设置为0
set(handles.edit2,'string',handles.jpeg);
set(handles.edit1,'string',handles.jpeg);
set(handles.edit7,'string',handles.ang);
guidata(hObject, handles);
guidata(hObject, handles);
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes watermaked wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = watermaked_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
contain_ind=rgb2gray(handles.contain); % 灰度图象 可以接受
figure,imshow(uint8(contain_ind)); title('原始图象');
guidata(hObject, handles);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
figure,imshow(handles.name);title('水印');
guidata(hObject, handles);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[handles.contain_lsb,handles.bit]=LSB;
figure,imshow(handles.contain_lsb);
handles.pnsr=PSNR(handles.contain,handles.contain_lsb);
title_string=strcat('含水印的图象(时域) PNSR:',num2str(handles.pnsr));
title(title_string);
guidata(hObject, handles);
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.watermarked_lsb=LSBextract(handles.contain,handles.contain_lsb,handles.name,handles.bit,handles.sel,handles.gau,handles.salt,handles.jpeg,handles.filt,handles.ang);
figure,imshow(uint8(handles.watermarked_lsb));title('提取的水印(时域)');
guidata(hObject, handles);
% --- Executes on button press in pushbutton20.
function pushbutton20_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton20 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
delete(get(0,'children'));
clear all;
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[handles.contain_marker_dwt,handles.SORT_IND]=testname;
figure,imshow(uint8(handles.contain_marker_dwt));title('含水印的图象(小波域)');
handles.pnsr=PSNR(handles.contain,handles.contain_marker_dwt);
title_string=strcat('含水印的图象(小波域) PNSR:',num2str(handles.pnsr));
title(title_string);
guidata(hObject, handles);
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.name_ex_dwt=extract_name(handles.contain,handles.contain_marker_dwt,handles.SORT_IND,handles.sel,handles.gau,handles.salt,handles.jpeg,handles.filt,handles.ang);
figure,imshow((handles.name_ex_dwt));title('提取的水印(小波域)');
guidata(hObject, handles);
% --- Executes on slider movement.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
[handles.contain_marker_dwt_times,handles.SORT_IND,handles.name1]=name_imbed;
figure,imshow(uint8(handles.contain_marker_dwt_times));title('含水印的图象(改进的小波域)');
handles.pnsr=PSNR(handles.contain,handles.contain_marker_dwt_times);
title_string=strcat('含水印的图象(改进的小波域) PNSR:',num2str(handles.pnsr));
title(title_string);
guidata(hObject, handles);
% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLA
没有合适的资源?快使用搜索试试~ 我知道了~
Matlab实现LSB算法源代码 有窗口 可添加攻击
共21个文件
m:10个
jpg:4个
asv:4个
需积分: 10 21 下载量 181 浏览量
2015-06-17
14:20:31
上传
评论 2
收藏 84KB ZIP 举报
温馨提示
使用MATLAB运行文件中watermaked文件,就可以进行操作。可在窗口中自由添加噪声攻击等内容以验证算法安全性
资源推荐
资源详情
资源评论
收起资源包目录
LSB.zip (21个子文件)
code2
reimrotate.m 719B
watermaked.fig 7KB
testname.m 3KB
nike.jpg 15KB
name32x32.jpg 945B
temp.jpg 12KB
nc.m 428B
name32x32.bmp 190B
extract.asv 4KB
LSB.m 712B
extract_name.m 4KB
watermaked.m 25KB
PSNR.m 405B
name_imbed.m 3KB
nvlang512x512.jpg 33KB
LSBextract.asv 2KB
upt.bmp 5KB
extract.m 4KB
extract_name.asv 4KB
name_imbed.asv 3KB
LSBextract.m 2KB
共 21 条
- 1
资源评论
whutzhanghao
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功