91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 7KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-18
  • 語言: Matlab
  • 標(biāo)簽: matlab??

資源簡介

matlab 基于zxing識別QR二維碼的GUI程序,本人QQ90333313,做的畢業(yè)設(shè)計(jì),可以探討探討

資源截圖

代碼片段和文件信息

function?varargout?=?main(varargin)
%?MAIN?MATLAB?code?for?main.fig
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?&&?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
function?main_OpeningFcn(hobject?eventdata?handles?varargin)
handles.output?=?hobject;
guidata(hobject?handles);
function?varargout?=?main_OutputFcn(hobject?eventdata?handles)?

varargout{1}?=?handles.output;
%?---?Executes?on?button?press?in?pushbutton1
function?pushbutton1_Callback(hobject?eventdata?handles)?????????????????%%%%%%%%打開圖像
global?im;
[filenamepathname]=uigetfile({‘*.*‘;‘*.bmp‘;‘*.jpg‘;‘*.tif‘;‘*.jpg‘}‘選擇圖像‘);
if?isequal(filename0)||isequal(pathname0)
??errordlg(‘您還沒有選取圖片??!‘‘溫馨提示‘);%如果沒有輸入,則創(chuàng)建錯誤對話框?
??return;
else
????image=[pathnamefilename];%合成路徑+文件名
????im=imread(image);%讀取圖像
????axes(handles.axes1);
????imshow(im);%在坐標(biāo)axes1顯示原圖像?
????title(‘原始QR圖像‘);
end
%?---?Executes?on?button?press?in?pushbutton3
function?pushbutton3_Callback(hobject?eventdata?handles)?????%???QR解碼顯示
global?I_otsu;???%global?定義全局變量
global?im;
global?KL;
global?Ijibian;
I_jiema=Ijibian;
I_jiema=I_otsu;??%二值
I_jiema=KL;
I_jiema=im;
str=zxing_decode(I_jiema);?????????????%解碼
set(handles.edit1‘String‘str);????????%顯示字符
%?---?Executes?on?button?press?in?pushbutton4
function?pushbutton4_Callback(hobject?eventdata?handles)???%???灰度化處理
global?im;
global?II;
I=im;
[whl]=size(I);????????%圖像大小??????
II=[];
for?i=1:h
???for?j=1:w
????II(ji)=0.3*I(ji1)+0.59*I(ji2)+0.11*I(ji3);???????%灰度化處理RGB三分量進(jìn)行加權(quán)平均能得到較合理的灰度圖像。
end
end
figureimshow(II[])??????????????????????????????????????%顯示圖像
title(‘QR二維碼灰度化處理‘);
%?---?Executes?on?button?press?in?pushbutton5
function?pushbutton5_Callback(hobject?eventdata?handles)???%???平滑處理
global?II;
global?I3;
III=uint8(II);???????????????????????????????%圖像轉(zhuǎn)換0-255
Ix=imnoise(III‘salt?&?pepper‘0.02);?????????%對灰度化圖像人為加噪聲
I3=medfilt2(Ix[33]);????????????????????????%平滑處理??中值濾波,[m?n]指定模版的大小,m行n列
figure
imshow(Ix)
title(‘QR二維碼加噪處理‘);
figure
imshow(I3)
title(‘QR二維碼平滑處理‘);
%?---?Executes?on?button?press?in?pushbutton6
function?pushbutton6_Callback(hobject?eventdata?handles)%%%%%%%%%%%%%%%%%%%????二值化處理
global?I3;
global?I_otsu;
I_otsu=otsut(I3);??????????????????????????????%二值化處理
figure
imshow(I_otsu[])
title(‘QR二維碼二值化處理‘);
function?edit1_Callback(hobject?eventdata?handles)
function?edit1_CreateFcn(hobject?eventdata?handles)

if?ispc?&&?isequal(get(hobject‘BackgroundColor‘)?get(0‘defaultUicontrolBackgroundColor‘))
????set(hobject‘BackgroundColor‘‘white‘);
end
%?---?Executes?on?button?press?in?push

評論

共有 條評論