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
没有合适的资源?快使用搜索试试~ 我知道了~
《Matlab计算机视觉与深度学习实战》代码 基于GUI搭建通用视频处理工具.zip
共127个文件
jpg:120个
m:4个
avi:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 190 浏览量
2023-07-15
16:31:27
上传
评论 1
收藏 967KB ZIP 举报
温馨提示
《Matlab计算机视觉与深度学习实战》代码
资源推荐
资源详情
资源评论
收起资源包目录
《Matlab计算机视觉与深度学习实战》代码 基于GUI搭建通用视频处理工具.zip (127个子文件)
out.avi 565KB
traffic.avi 204KB
MainFrame.fig 47KB
073.jpg 5KB
075.jpg 5KB
074.jpg 5KB
076.jpg 5KB
072.jpg 5KB
077.jpg 5KB
071.jpg 5KB
039.jpg 5KB
037.jpg 5KB
038.jpg 5KB
078.jpg 5KB
070.jpg 5KB
040.jpg 5KB
094.jpg 5KB
036.jpg 5KB
079.jpg 5KB
095.jpg 5KB
100.jpg 5KB
069.jpg 5KB
096.jpg 4KB
042.jpg 4KB
093.jpg 4KB
041.jpg 4KB
068.jpg 4KB
025.jpg 4KB
023.jpg 4KB
035.jpg 4KB
092.jpg 4KB
080.jpg 4KB
024.jpg 4KB
097.jpg 4KB
052.jpg 4KB
043.jpg 4KB
034.jpg 4KB
051.jpg 4KB
067.jpg 4KB
116.jpg 4KB
099.jpg 4KB
098.jpg 4KB
091.jpg 4KB
053.jpg 4KB
022.jpg 4KB
033.jpg 4KB
066.jpg 4KB
065.jpg 4KB
117.jpg 4KB
026.jpg 4KB
081.jpg 4KB
050.jpg 4KB
090.jpg 4KB
064.jpg 4KB
101.jpg 4KB
115.jpg 4KB
032.jpg 4KB
021.jpg 4KB
089.jpg 4KB
063.jpg 4KB
020.jpg 4KB
044.jpg 4KB
054.jpg 4KB
062.jpg 4KB
031.jpg 4KB
088.jpg 4KB
118.jpg 4KB
114.jpg 4KB
030.jpg 4KB
019.jpg 4KB
049.jpg 4KB
087.jpg 4KB
061.jpg 4KB
060.jpg 4KB
086.jpg 4KB
102.jpg 4KB
059.jpg 4KB
029.jpg 4KB
027.jpg 4KB
085.jpg 4KB
113.jpg 4KB
045.jpg 4KB
048.jpg 4KB
082.jpg 4KB
028.jpg 4KB
058.jpg 4KB
055.jpg 4KB
084.jpg 4KB
112.jpg 4KB
083.jpg 4KB
057.jpg 4KB
047.jpg 4KB
056.jpg 4KB
119.jpg 4KB
046.jpg 4KB
111.jpg 4KB
110.jpg 4KB
103.jpg 4KB
018.jpg 4KB
109.jpg 4KB
共 127 条
- 1
- 2
资源评论
AbelZ_01
- 粉丝: 1029
- 资源: 5444
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 换热器黄铜管与爆炸复合板焊接工艺的研究.pdf
- 换热器管子与管板的焊接与检验的国外工程标准简介.pdf
- 黄铜换热器管头焊接工艺研究.pdf
- 回火焊道焊接技术的研究进展 - .pdf
- 活性激光电弧复合焊接法研究.pdf
- 火电机组焊接技术的发展及质量控制.pdf
- 活性剂钨极惰性气体保护电弧焊接熔池行为的观察.pdf
- 火电机组凝汽器钛管焊接 - .pdf
- 火电建设工程施工工艺示范手册3(油漆、保温、焊接).pdf
- 火电施工质量检验及评定标准(焊接篇).pdf
- java图片浏览小程序源代码.zip
- 基于ssm的大学生就业帮助系统源码(java毕业设计完整源码+LW).zip
- 问卷星调查问卷自动填写工具python源码(课程作业).zip
- java图书管理系统源代码.zip
- ECharts地图-自定义23.zip
- 货车制动管自动环缝焊接专机控制系统.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功