function varargout = imqacdemo03(varargin)
% IMQACDEMO03 M-file for imqacdemo03.fig
% IMQACDEMO03, by itself, creates a new IMQACDEMO03 or raises the existing
% singleton*.
%
% H = IMQACDEMO03 returns the handle to a new IMQACDEMO03 or the
% handle to
% the existing singleton*.
%
% IMQACDEMO03('CALLBACK',hObject,eventData,handles,...) calls the
% local
% function named CALLBACK in IMQACDEMO03.M with the given input arguments.
%
% IMQACDEMO03('Property','Value',...) creates a new IMQACDEMO03 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before imqacdemo03_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to imqacdemo03_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
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help imqacdemo03
% Last Modified by GUIDE v2.5 23-Jul-2004 12:45:11
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @imqacdemo03_OpeningFcn, ...
'gui_OutputFcn', @imqacdemo03_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 imqacdemo03 is made visible.
function imqacdemo03_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 imqacdemo03 (see VARARGIN)
handles.output = hObject;
Monitor_Mode(hObject, eventdata, handles);
S = imread('autumn.tif');
handles.S = S;
axes(handles.axes1);
subimage(S);
S2 = imread('autumn.tif');
axes(handles.axes2);
subimage(S2);
handles.S2 = S2;
guidata(hObject, handles);
% UIWAIT makes imqacdemo03 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = imqacdemo03_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 pbStart.
function pbStart_Callback(hObject, eventdata, handles)
% hObject handle to pbStart (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if isfield(handles,'outdata')
handles = rmfield(handles,'outdata');
end
guidata(hObject, handles);
set(handles.pbStart,'enable','off');
set(handles.pbStop,'enable','on');
set(handles.pbStop,'UserData',0);
vid = videoinput('winvideo');
handles.vid = vid;
set(handles.vid,'FramesPerTrigger',1);
set(handles.vid,'TriggerRepeat',Inf);
triggerconfig(handles.vid, 'Manual');
guidata(hObject, handles);
start(handles.vid);
trigger(handles.vid);
y = (getdata(handles.vid,1,'uint8'));
cnt_move = 0;
cnt_unmove = 0;
cntsnap = 1;
while 1
trigger(handles.vid);
yprev = y;
set(handles.editTime,'string',datestr(clock));
if get(handles.pbStop,'UserData')
break
else
y = (getdata(handles.vid,1,'uint8'));
diff = abs(y-yprev);
abs_img = mean(diff(:));
set(handles.editAbs,'string',abs_img);
axes(handles.axes1);subimage(y);
axes(handles.axes2);subimage(diff);
out = imaqmem;
mem_left = out.FrameMemoryLimit - out.FrameMemoryUsed;
set(handles.editMemLeft,'string',mem_left/10^6);
set(handles.editMemLoad,'string',out.MemoryLoad);
if abs_img > str2num(get(handles.editThresh,'string'));
cnt_move = cnt_move + 1;
set(handles.editObj,'string',cnt_move);
if cnt_move >= str2num(get(handles.editSnapCnt,'string'));
handles.outdata.image(:,:,:,cntsnap) = y;
handles.outdata.time{cntsnap} = datestr(clock);
cntsnap = cntsnap + 1;
cnt_move = 0;
set(handles.editSnap,'string',cntsnap-1);
end
cnt_unmove = 0;
else
cnt_unmove = cnt_unmove + 1;
cnt_move = 0;
set(handles.editObj,'string',cnt_move);
end
end
end
axes(handles.axes1);
cla;
subimage(handles.S);
axes(handles.axes2);
cla;
subimage(handles.S2);
delete(handles.vid);
clear handles.vid;
imaqreset;
guidata(hObject, handles);
% --- Executes on button press in pbStop.
function pbStop_Callback(hObject, eventdata, handles)
% hObject handle to pbStop (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.pbStart,'enable','on');
set(handles.pbStop,'enable','off');
set(handles.pbStop,'UserData',1);
set(handles.pbStop,'UserData',1);
set(handles.pbStop,'UserData',1);
set(handles.pbStop,'UserData',1);
set(handles.pbStop,'UserData',1);
guidata(hObject, handles);
function editAbs_Callback(hObject, eventdata, handles)
% hObject handle to editAbs (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,'String') returns contents of editAbs as text
% str2double(get(hObject,'String')) returns contents of editAbs as a double
% --- Executes during object creation, after setting all properties.
function editAbs_CreateFcn(hObject, eventdata, handles)
% hObject handle to editAbs (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function editMemLeft_Callback(hObject, eventdata, handles)
% hObject handle to editMemLeft (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,'String') returns contents of editMemLeft as text
% str2double(get(hObject,'String')) returns contents of editMemLeft as a double
% --- Executes during object creation, after setting all properties.
function editMemLeft_CreateFcn(hObject, eventdata, handles)
% hObject handle to editMemLeft (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function editMemLoad_C
没有合适的资源?快使用搜索试试~ 我知道了~
用MAtlab写的不错的运动目标检测的分析平台.研究人员可借此学习在Matlab71上如何编写图形化界面的程序,同时可以将自己的...
共4个文件
txt:1个
fig:1个
m:1个
5星 · 超过95%的资源 需积分: 11 60 下载量 87 浏览量
2010-11-21
15:49:38
上传
评论 4
收藏 127KB RAR 举报
温馨提示
用MAtlab写的不错的运动目标检测的分析平台.研究人员可借此学习在Matlab71上如何编写图形化界面的程序,同时可以将自己的代码在平台上面运行,方面地查看运行的效果.rar
资源推荐
资源详情
资源评论
收起资源包目录
用MAtlab写的不错的运动目标检测的分析平台.研究人员可借此学习在Matlab71上如何编写图形化界面的程序,同时可以将自己的代码在平台上面运行,方面地查看运行的效果.rar (4个子文件)
用MAtlab写的不错的运动目标检测的分析平台.研究人员可借此学习在Matlab71上如何编写图形化界面的程序,同时可以将自己的代码在平台上面运行,方面地查看运行的效果
imqacdemo03.m 19KB
autumn.tif 209KB
imqacdemo03.fig 11KB
www.pudn.com.txt 218B
共 4 条
- 1
资源评论
- 虾米茄子1232014-10-03不错的学习资料
- 驯猫大师2015-09-05不错,简单易懂
- qq_221758172015-03-12的确不错。对我的学习很有帮助
一座青山
- 粉丝: 128
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 筷手引流工具.apk
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功