云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > LSB图片信息隐藏隐藏实验

LSB图片信息隐藏隐藏实验

  • 62 次阅读
  • 3 次下载
  • 2026/4/26 23:11:47

附件: 源代码:

function varargout = LSB3333(varargin) % LSB3333 MATLAB code for LSB3333.fig

% LSB3333, by itself, creates a new LSB3333 or raises the existing % singleton*. %

% H = LSB3333 returns the handle to a new LSB3333 or the handle to % the existing singleton*. %

% LSB3333('CALLBACK',hObject,eventData,handles,...) calls the local

% function named CALLBACK in LSB3333.M with the given input arguments. %

% LSB3333('Property','Value',...) creates a new LSB3333 or raises the % existing singleton*. Starting from the left, property value pairs are

% applied to the GUI before LSB3333_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application

% stop. All inputs are passed to LSB3333_OpeningFcn via varargin. %

% *See GUI Options on GUIDE's Tools menu. Choose \one

% instance to run (singleton)\ %

% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help LSB3333

% Last Modified by GUIDE v2.5 14-Apr-2015 10:08:25

% Begin initialization code - DO NOT EDIT gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @LSB3333_OpeningFcn, ... 'gui_OutputFcn', @LSB3333_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1})

gui_State.gui_Callback = str2func(varargin{1}); end

11

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 LSB3333 is made visible.

function LSB3333_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 LSB3333 (see VARARGIN)

% Choose default command line output for LSB3333 handles.output = hObject;

% Update handles structure guidata(hObject, handles);

% UIWAIT makes LSB3333 wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line. function varargout = LSB3333_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 pbtCover.

function pbtCover_Callback(hObject, eventdata, handles) % hObject handle to pbtCover (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global gCover;

[gCover,sFile]=loadimg();

12

if isempty(gCover)

msgbox('Cover image is empty!','Warning','warn','modal'); return; end

axes(handles.axCover); imshow(gCover);

[iH iW iL]=size(gCover);

sMsg=[sFile,'[',num2str(iH),'*',num2str(iW),'*',num2str(iL),']']; set(handles.text1,'String',sMsg);

% --- Executes on button press in pbtSecret.

function pbtSecret_Callback(hObject, eventdata, handles) % hObject handle to pbtSecret (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global gSecret;

[gSecret ,sFile]=loadimg(); if isempty(gSecret)

msgbox('Secret image is empty!','Warning','warn','modal'); return; end

axes(handles.axSecret); imshow(gSecret);

[iH iW iL]=size(gSecret);

sMsg=[sFile,'[',num2str(iH),'*',num2str(iW),'*',num2str(iL),']']; set(handles.text1,'String',sMsg);

set(handles.text2,'String','Secret Image');

% --- Executes on button press in pbtEmbed.

function pbtEmbed_Callback(hObject, eventdata, handles) % hObject handle to pbtEmbed (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global gCover gSecret gStego; if isempty(gCover)

msgbox('Cover image is empty!' , 'Warning' , 'warn' , 'modal' ); return; end

if isempty(gSecret)

msgbox('gSecret image is empty!' , 'Warning' , 'warn' , 'modal' ); return;

13

end

[Hc,Wc,Lc]=size(gCover); [Hs,Ws,Ls]=size(gSecret);

if (Hc~=Hs) || (Wc~=Ws) || (Lc~=Ls) disp('Error: Not Match!' ); return; end

gStego = uint8(bitor(bitand(gCover,254),bitshift(gSecret,-7))); imwrite(gStego, '~emTmp.bmp' ); axes(handles.axStego); imshow(gStego,[]);

% --- Executes on button press in pbtExtract.

function pbtExtract_Callback(hObject, eventdata, handles) % hObject handle to pbtExtract (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global gStego; global gCover gSecret; if isempty(gCover)

msgbox('Cover image is empty!' , 'Warning' , 'warn' , 'modal' ); return; end

if isempty(gSecret)

msgbox('gSecret image is empty!' , 'Warning' , 'warn' , 'modal' ); return; end

[Hc,Wc,Lc]=size(gCover); [Hs,Ws,Ls]=size(gSecret);

if (Hc~=Hs) || (Wc~=Ws) || (Lc~=Ls) disp('Error: Not Match!' ); return; end

gStego = uint8(bitor(bitand(gCover,254),bitshift(gSecret,-7))); imwrite(gStego, '~emTmp.bmp' ); axes(handles.axStego); imshow(gStego,[]);

if isempty(gStego)

msgbox('Stego image is empty!' , 'Warning' , 'warn' , 'modal' ); return; end

imExtract = uint8(bitand(255,bitshift(gStego,7))); imwrite(imExtract, '~exTmp.bmp' );

14

搜索更多关于: LSB图片信息隐藏隐藏实验 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

附件: 源代码: function varargout = LSB3333(varargin) % LSB3333 MATLAB code for LSB3333.fig % LSB3333, by itself, creates a new LSB3333 or raises the existing % singleton*. % % H = LSB3333 returns the handle to a new LSB3333 or the handle to % the existing singleton*. % % LSB3333('CALLBACK',hObject,eventData,handles,...) calls the local

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com