function varargout = MainFrame(varargin)
% MAINFRAME MATLAB code for MainFrame.fig
% MAINFRAME, by itself, creates a new MAINFRAME or raises the existing
% singleton*.
%
% H = MAINFRAME returns the handle to a new MAINFRAME or the handle to
% the existing singleton*.
%
% MAINFRAME('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MAINFRAME.M with the given input arguments.
%
% MAINFRAME('Property','Value',...) creates a new MAINFRAME or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before MainFrame_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to MainFrame_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 MainFrame
% Last Modified by GUIDE v2.5 30-Apr-2017 06:35:20
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @MainFrame_OpeningFcn, ...
'gui_OutputFcn', @MainFrame_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 MainFrame is made visible.
function MainFrame_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 MainFrame (see VARARGIN)
% Choose default command line output for MainFrame
handles.output = hObject;
clc;
handles.videoFilePath = 0;
handles.videoInfo = 0;
handles.videoImgList = 0;
handles.videoStop = 1;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes MainFrame wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = MainFrame_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 pushbuttonPlay.
function pushbuttonPlay_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonPlay (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 播放按钮
set(handles.pushbuttonPause, 'Enable', 'On');
set(handles.pushbuttonPause, 'tag', 'pushbuttonPause', 'String', '暂停');
set(handles.sliderVideoPlay, 'Max', handles.videoInfo.NumberOfFrames, 'Min', 0, 'Value', 1);
set(handles.editSlider, 'String', sprintf('%d/%d', 0, handles.videoInfo.NumberOfFrames));
% 循环载入视频帧图像并显示
for i = 1 : handles.videoInfo.NumberOfFrames
waitfor(handles.pushbuttonPause,'tag','pushbuttonPause');
I = imread(fullfile(pwd, sprintf('video_images\\%03d.jpg', i)));
try
imshow(I, [], 'Parent', handles.axesVideo);
% 设置进度条
set(handles.sliderVideoPlay, 'Value', i);
set(handles.editSlider, 'String', sprintf('%d/%d', i, handles.videoInfo.NumberOfFrames));
catch
return;
end
drawnow;
end
% 控制暂停按钮
set(handles.pushbuttonPause, 'Enable', 'Off');
% --- Executes on button press in pushbuttonOpenVideoFile.
function pushbuttonOpenVideoFile_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonOpenVideoFile (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 打开视频文件按钮
videoFilePath = OpenVideoFile();
if videoFilePath == 0
return;
end
set(handles.editVideoFilePath, 'String', videoFilePath);
msgbox('打开视频文件成功!', '提示信息');
handles.videoFilePath = videoFilePath;
guidata(hObject, handles);
% --- Executes on button press in pushbuttonImageList.
function pushbuttonImageList_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonImageList (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 获取图像序列按钮
if handles.videoInfo == 0
msgbox('请先获取视频信息', '提示信息');
return;
end
Video2Images(handles.videoFilePath);
msgbox('获取图像序列成功!', '提示信息');
% --- Executes on button press in pushbuttonStopCheck.
function pushbuttonStopCheck_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonStopCheck (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 视频分析
[s, sx, sy] = MotionAnalysis();
handles.s = s;
handles.sx = sx;
handles.sy = sy;
% Update handles structure
guidata(hObject, handles);
% --- Executes on button press in pushbuttonPause.
function pushbuttonPause_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonPause (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 暂停按钮
% 获取响应标记
str = get(handles.pushbuttonPause, 'tag');
if strcmp(str, 'pushbuttonPause') == 1
set(handles.pushbuttonPause, 'tag', 'pushbuttonContinue', 'String', '继续');
pause on;
else
set(handles.pushbuttonPause, 'tag', 'pushbuttonPause', 'String', '暂停');
pause off;
end
% --- Executes on button press in pushbuttonStop.
function pushbuttonStop_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonStop (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 停止按钮
axes(handles.axesVideo); cla; axis on; box on;
set(gca, 'XTick', [], 'YTick', [], ...
'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000]);
set(handles.editSlider, 'String', '0/0');
set(handles.sliderVideoPlay, 'Value', 0);
set(handles.pushbuttonPause, 'tag', 'pushbuttonContinue', 'String', '继续');
set(handles.pushbuttonPause, 'Enable', 'Off');
set(handles.pushbuttonPause, 'String', '暂停');
function editFrameNum_Callback(hObject, eventdata, handles)
% hObject handle to editFrameNum (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 editFrameNum as text
% str2double(get(hObject,'String')) returns contents of editFrameNum as a double
% --- Executes during object creation, after setting all properties.
function editFrameNum_CreateFcn(hObject, eventdata, handles)
% hObject handle to editFrameNum (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function editFrameWidth_Callback(hObject, eventdata, handles)
% hObject handle to editFrameWidth (see GCBO)
% eventdata reserved - to be defined in a future version of MATLA
![avatar](https://profile-avatar.csdnimg.cn/807743f7da1e4eeeafb6487e63d8009b_qq_45527691.jpg!1)
AbelZ_01
- 粉丝: 1043
- 资源: 5445
最新资源
- GXX-MLSGA40 高新兴国迈视音频一体化管理平台V4.2.0_部署手册.docx
- 智能家居专用-STM32 以太网开发板电路设计(含功能试验源码、原理图、开源带例程)
- 基于MATLAB2020b和Carsim2020的模型预测控制(MPC)与路径跟踪(PTC)结合侧偏角软约束及主动前轮转向仿真研究,基于MATLAB2020b与Carsim2020的模型预测控制(MP
- 基于SHO-CNN-SVM图像识别模型:多层次卷积池化与海马优化算法的深度应用,为口腔溃疡图像数据集带来高精度迁移性优势,支持灵活替换算法体系,基于SHO-CNN-SVM算法的图像识别模型:多元特征提
- 毕设springboot在线拍卖系统
- 基于图卷积神经网络(GCN)的数据分类预测:Matlab 2022A版本及以上的GCN模型实现代码指南,基于图卷积神经网络(GCN)的Matlab代码实现与数据分类预测应用指南(适用于Matlab 2
- 基于魔术公式的非线性七自由度车辆Simulink模型与二、三自由度车辆模型对照研究及动力学模型参考分析,基于魔术公式的非线性七自由度车辆Simulink模型与二、三自由度对照研究,包含驱动力矩、制动力
- 基于Simulink的无线充电仿真:LCC谐振器与磁耦合谐振的恒压恒流输出研究及四套模型解析,基于Simulink的无线充电仿真:探讨LCC谐振器与磁耦合谐振的恒压恒流输出及拓扑补偿技术,无线充电仿真
- 经典Banba低压带隙基准电路,SMIC 130nm工艺,输出890mv,可调整电压值,含完整版图的Bandgap电路与二级密勒补偿运放仿真结果展示,经典Banba低压带隙基准,电流模结构,工艺SMI
- 智能家居系统设计(附智能照明、自动浇花、宠物喂食器功能)【含代码、文档】
- Simulink整车控制器VCU模型:简洁易懂,经过实车验证,展现卓越处理能力与可读性-自动驾驶部分待调试屏蔽状态,Simulink整车控制器VCU模型:简单易懂,经实车验证!适当处理,注重可读性
- 50%占空比振荡器:开关电源核心元件,带修调功能,学习实践之理想选择,50%占空比振荡器:开关电源的理想选择,带修调功能,助力学习与实践,50%占空比振荡器,适用于开关电源,带修调,适合学习 ,50%
- 编队控制中的分布式线性二次离散时间博弈方法:碰撞避免策略的探索与应用,编队控制与博弈的分布式线性二次离散时间方法:碰撞避免策略研究,26.避免碰撞的编队控制分布式线性二次离散时间博弈方法 ,避免碰撞
- 智能家居管理系统设计(原理图+APP+源代码等)
- 基于Dugoff轮胎模型的车辆七自由度模型研究及魔术轮胎公式在路面附着系数估计中的应用-附参考文献与说明文档,基于Dugoff轮胎模型的车辆七自由度模型研究及魔术轮胎公式在路面附着系数估计中的应用说
- 基于博途1200 PLC与HMI的智能花式喷泉控制系统仿真工程:四模式喷水花样实现与优化,基于博途1200 PLC与HMI联合的花式喷泉控制系统仿真研究与实践教程,基于博途1200PLC+HMI花式喷
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)