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
% 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;
% 初始化
warning off all;
clc;
handles.videoFilePath = 0;
handles.videoInfo = 0;
handles.videoImgList = 0;
handles.videoStop = 1;
handles.videoTrackFlag = 0;
handles.pts = 0;
handles.tms = 0;
% 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)
% 播放按钮
if isequal(handles.videoFilePath, 0) || isequal(handles.videoInfo, 0)
% 如果没有视频
msgbox('Please Get Video Information', 'Info');
return;
end
% 当前动作
set(handles.edit_action, 'String', 'Play');
% 文件名称
[pathstr, name, ext] = fileparts(handles.videoFilePath);
% 按钮属性
set(handles.pushbuttonPause, 'Enable', 'On');
set(handles.pushbuttonPause, 'tag', 'pushbuttonPause', 'String', 'Pause');
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('%s_images\\%04d.jpg', name, 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.edit_action, 'String', 'Open Video File');
% 显示选择路径
set(handles.editVideoFilePath, 'String', videoFilePath);
% 提示
msgbox('Open File Success', 'Info');
% 存储
handles.videoFilePath = videoFilePath;
guidata(hObject, handles);
% --- Executes on button press in pushbuttonkemspgz.
function pushbuttonkemspgz_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonkemspgz (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 获取视频路径
videoFilePath = handles.videoFilePath;
if isequal(videoFilePath, 0)
% 如果无效
return;
end
% 当前动作
set(handles.edit_action, 'String', 'Init Target');
% 处理定位
ProcessVideo(videoFilePath);
% 获取定位结果
load(fullfile(pwd, 'R.mat'));
% 存储
handles.pts = R;
% 显示
axis(handles.axesVideo);
hold on;
rectangle('Position', R(1, :), 'EdgeColor', 'r');
hold off;
% Update handles structure
guidata(hObject, handles);
% 提示
msgbox('Success', 'Info');
% --- 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 isequal(handles.videoFilePath, 0) || isequal(handles.videoInfo, 0)
% 如果无效
msgbox('Please Get Video Information', 'Info');
return;
end
% 当前动作
set(handles.edit_action, 'String', 'Video ImageList');
% 获取帧序列
Video2Images(handles.videoFilePath);
% Update handles structure
guidata(hObject, handles);
% 提示
msgbox('Get Video ImageList Success', 'Info');
% --- 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)
% 视频分析
if isequal(handles.pts, 0)
% 如果没有定位
msgbox('Please Get Video Init', 'Info');
return;
end
% 当前动作
set(handles.edit_action, 'String', 'Video Tracking');
% 获取定位结果
pts = handles.pts;
% 视频名称
[~, name, ~] = fileparts(handles.videoFilePath);
% 设置按钮属性
set(handles.pushbuttonPause, 'Enable', 'On');
set(handles.pushbuttonPause, 'tag', 'pushbuttonPause', 'String', 'Pause');
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('%s_images\\%04d.jpg', name, i)));
% 显示
axes(handles.axesVideo); cla;
imshow(I, [], 'Parent', handles.axesVideo);
% 设置进度
set(handles.sliderVideoPlay, 'Value', i);
set(handles.editSlider, 'String', sprintf('%d/%d', i, handles.videoInfo.NumberOfFrames));
if ~isnan(pts(i, 1)) && pts(i, 1) > 0
% 如图定位有效
hold on;
% 显示定位区域
rectangle('Pos
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
1、资源内容:基于Matlab实现运动目标跟踪检测(源码+图片集+视频).rar 2、适用人群:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业或毕业设计中的部分功能,作为“参考资料”使用。 3、解压说明:本资源需要电脑端使用WinRAR、7zip等解压工具进行解压,没有解压工具的自行百度下载即可。 4、免责声明:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。不一定能够满足所有人的需求,需要有一定的基础能够看懂代码,能够自行调试代码并解决报错,能够自行添加功能修改代码。由于作者大厂工作较忙,不提供答疑服务,如不存在资源缺失问题概不负责,谢谢理解。
资源推荐
资源详情
资源评论
收起资源包目录
基于Matlab实现运动目标跟踪检测(源码+图片集+视频).rar (2000个子文件)
MainFrame.fig 45KB
0003.jpg 97KB
1222.jpg 97KB
1223.jpg 97KB
0004.jpg 97KB
1220.jpg 97KB
0241.jpg 96KB
0242.jpg 96KB
0023.jpg 96KB
0008.jpg 96KB
0026.jpg 96KB
0594.jpg 96KB
0015.jpg 96KB
0025.jpg 96KB
0009.jpg 96KB
0016.jpg 96KB
0021.jpg 96KB
0014.jpg 96KB
0596.jpg 96KB
0007.jpg 96KB
0011.jpg 96KB
0019.jpg 96KB
0597.jpg 96KB
0012.jpg 96KB
1218.jpg 96KB
0266.jpg 96KB
0564.jpg 96KB
0018.jpg 96KB
0565.jpg 96KB
0590.jpg 96KB
0598.jpg 96KB
0586.jpg 96KB
0587.jpg 96KB
0562.jpg 96KB
1226.jpg 96KB
0600.jpg 96KB
0563.jpg 96KB
0327.jpg 96KB
0584.jpg 96KB
0323.jpg 96KB
0568.jpg 96KB
0301.jpg 96KB
0328.jpg 96KB
0329.jpg 96KB
0268.jpg 96KB
0265.jpg 96KB
0120.jpg 96KB
0119.jpg 96KB
0560.jpg 96KB
0322.jpg 96KB
0115.jpg 96KB
0310.jpg 96KB
0150.jpg 96KB
0059.jpg 96KB
0058.jpg 96KB
0044.jpg 96KB
0583.jpg 95KB
0046.jpg 95KB
0144.jpg 95KB
1246.jpg 95KB
0559.jpg 95KB
0149.jpg 95KB
0057.jpg 95KB
0054.jpg 95KB
0147.jpg 95KB
0110.jpg 95KB
0045.jpg 95KB
0060.jpg 95KB
1217.jpg 95KB
0142.jpg 95KB
0114.jpg 95KB
0047.jpg 95KB
0048.jpg 95KB
0141.jpg 95KB
0247.jpg 95KB
0302.jpg 95KB
0112.jpg 95KB
0113.jpg 95KB
1248.jpg 95KB
0107.jpg 95KB
0239.jpg 95KB
0312.jpg 95KB
0074.jpg 95KB
0139.jpg 95KB
1251.jpg 95KB
0140.jpg 95KB
0137.jpg 95KB
0303.jpg 95KB
0264.jpg 95KB
0308.jpg 95KB
0136.jpg 95KB
0135.jpg 95KB
0106.jpg 95KB
0108.jpg 95KB
1244.jpg 95KB
0089.jpg 95KB
0081.jpg 95KB
0038.jpg 95KB
0121.jpg 95KB
0234.jpg 95KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- 皮卡7992024-05-07资源很实用,内容详细,值得借鉴的内容很多,感谢分享。
- 阿怪952024-04-30资源内容总结地很全面,值得借鉴,对我来说很有用,解决了我的燃眉之急。
- qq_508576092024-04-27超级好的资源,很值得参考学习,对我启发很大,支持!
Matlab仿真实验室
- 粉丝: 2w+
- 资源: 2180
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Pyortch+python+三种卷积神经实现的深度神经网络的交通标志识别算法python源码+文档说明+数据集
- 深度学习课程设计-基于虚拟仿真环境下的自动驾驶交通标志识别python源码+文档说明+数据+模型权重
- 互联网金融第二章——互联网金融支付-PPT.ppt
- 基于OpenCV实现的交通标志识别C++源码+文档说明+测试图片(课程设计)
- 基于虚拟仿真环境下的自动驾驶交通标志识别python源码+文档说明+截图演示+数据集+使用教学(98分高分毕业设计)
- python实现的基于CNN深度学习网络的交通标志识别+源代码+文档说明+安装教程+使用教程(高分毕业设计)
- 基于Spring Bootd实现的图像去雾系统端,完成主要的前后端交互+源代码+文档说明
- 企业网站建设-PPT.ppt
- 办公自动化Microsoft-Office学习教程.doc
- 办公软件ECEL技巧培训课件-PPT.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功