function varargout = show(varargin)
% SHOW MATLAB code for show.fig
% SHOW, by itself, creates a new SHOW or raises the existing
% singleton*.
%
% H = SHOW returns the handle to a new SHOW or the handle to
% the existing singleton*.
%
% SHOW('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SHOW.M with the given input arguments.
%
% SHOW('Property','Value',...) creates a new SHOW or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before show_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to show_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 show
% Last Modified by GUIDE v2.5 05-May-2023 08:27:00
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @show_OpeningFcn, ...
'gui_OutputFcn', @show_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 show is made visible.
function show_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 show (see VARARGIN)
% Choose default command line output for show
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes show wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = show_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 button_start.
function button_start_Callback(hObject, eventdata, handles)
% hObject handle to button_start (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%1.Get the hardware information //获取硬件信息
global obj;%obj在其他地方要调用,所以设为全局变量
info=imaqhwinfo('winvideo');%获得摄像头硬件信息
obj=videoinput('winvideo',info.DeviceIDs{1});%创建视频对象
set(obj,'FramesPerTrigger',1);%每次触发存储一张相片
set(obj,'ReturnedColorSpace','RGB');%接收图像为RGB模式
%get(obj)%获取obj信息,查看设置是否成功,最后注释掉
axes(handles.axes1);
%2.show the video //动态显示视频图像
Resolution=get(obj,'videoResolution');%分辨率
nBands=get(obj,'NumberOfBands');%频段
hImage=image(zeros(Resolution(2),Resolution(1),nBands));
preview(obj,hImage);%在特定的位置(hImage)显示
% --- Executes on button press in button_catch.
function button_catch_Callback(hObject, eventdata, handles)
% hObject handle to button_catch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global obj;
catch_pic=getsnapshot(obj);%摄取图像
catch_pic=imresize(catch_pic,[240, 320]); %统一图片大小
axes(handles.axes2);
imshow(catch_pic);%在axes2显示摄取的图片
setappdata(gcf,'pic',catch_pic);%把catch_pic变成全局变量
% --- Executes on button press in button_cut.
function button_cut_Callback(hObject, eventdata, handles)
% hObject handle to button_cut (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
pic = getappdata(gcf,'pic'); %获取全局变量
l = get(handles.popupmenu_choose,'value'); %获取下拉菜单选中项
if l==1 %基于YCgCr肤色分割(适用于较复杂背景)
pic_cut = colour_cut(pic);
end
axes(handles.axes3);
imshow(pic_cut);
setappdata(gcf,'pic_cut',pic_cut);%把catch_pic变成全局变量
% --- Executes on selection change in popupmenu_choose.
function popupmenu_choose_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_choose (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_choose contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu_choose
% --- Executes during object creation, after setting all properties.
function popupmenu_choose_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu_choose (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton_open.
function pushbutton_open_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename, pathname] = uigetfile( ...
{'*.bmp;*.jpg;*.fig;*.tif','MATLAB Files (*.bmp;*.jpg;*.fig;*.tif)';
'*.*', 'All Files (*.*)'}, ...
'Pick a file');
pic=imread([pathname,filename]);%读取图片给im
pic=imresize(pic,[240, 320]); %统一图片大小
axes(handles.axes2);
imshow(pic);%在axes2显示摄取的图片
setappdata(gcf,'pic',pic);%把pic变成全局变量
% --- Executes on button press in pushbutton_denoise.
function pushbutton_denoise_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_denoise (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
str1=sprintf('思路\n\n');
str2=sprintf('欢迎沟通交流Q:3752243968\n');
string=[str1 str2];
msgbox(string,'温馨提示','none');
% --- Executes on selection change in popupmenu_operator.
function popupmenu_operator_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_operator (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_operator contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu_operator
% --- Executes during object creation, after setting all properties.
function popupmenu_operator_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu_operator (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton_edge.
function pushbutton_edge_Callback(hObject, eventdata, handles)
% hObject handle to pushbutt
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
第 61 章 基于matlab手势识别.zip (18个子文件)
第 61 章 基于matlab手势识别
threshold_cut.m 851B
colour_cut.m 746B
denoise.m 487B
image
5.JPG 36KB
4.JPG 36KB
3.JPG 36KB
1.JPG 39KB
6.jpg 1.17MB
2.JPG 34KB
fourierdescriptors.m 654B
0识别结果图.png 131KB
ModHausdorffDist.m 2KB
show.fig 74KB
localenhance.m 616B
Humoment.m 1KB
minboundrect.m 6KB
show.m 17KB
data.mat 1KB
共 18 条
- 1
资源评论
Matlab程序设计
- 粉丝: 15
- 资源: 105
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功