1. MATLAB版配置教程
1.1 tracker_benchmark_v1.0说明
tracker_benchmark_v1.0是OTB(object tracking benchmark)的matlab版本,实际是吴毅老师的两篇论文
- OTB50(OTB2013)包含50个视频序列
1.2 下载源码
去官网Visual Tracker Benchmark下载tracker_benchmark_v1.0的源码
其中MATLAB版是matlab实现的接口,Python版是后来新增的接口,可以根据需要选择对应的版本,本次配置以matlab版为例进行配置
1.3 解压源码
解压以后目录结构如图所示
首先对目录中各文件进行说明
- anno文件:主要存储的是数据集的bounding box
- figs文件:存储的是一些实验跑出的图片,就是各种属性的准确度或者成功率图
- initOmit文件:包含由于遮挡或目标超出视野而被省略的用于跟踪初始化的帧的注释的目录
- perfMat文件:存储最终用于画图的mat文件
- results文件:存储每个trackers的跟踪结果的mat文件和perfMat不一样,这个是相对于bounding box的跟踪框数据
- rstEval文件: 包含了很多用于计算跟踪性能或者画出结果的脚本的目录
- tmp文件:用来存放临时结果或者日志文件的目录
- trackers文件:里面包含各种你需要对比的跟踪算法,要简单了解可以看trackers.txt文件
- util文件:里面包含各种重要的函数
- drawResultBB.m:用于画每个帧上不同跟踪器的边界框的主函数
- main_running.m:是于在测试集上跑跟踪代码的,跑出的结果存在results文件夹中
- perfPlot.m:用来画测试结果图,就是benchmark网上的图的效果,如果你第一次下载tracker_benchmark_v1.0的测试代码,可以先运行perfPlot.m就可以直接画出漂亮的图。只不过这些图是已有的跟踪算法和测试结果,作者都保存在results文件夹里面了
1.4 下载vlfeat工具
由于tracker_benchmark_v1.0用到了vlfeat的内容,因此需要首先加载vlfeat的源码,vlfeat官网下载链接:http://www.vlfeat.org/
解压下载的vlfeat源码,然后修改main_runing.m中的vlfeat路径为自己的源码位置
addpath(('./vlfeat-0.9.21\toolbox'));
1.5 整理测试序列
- 首先下载OTB100数据集
- 在tracker_benchmark_v1.0根路径下创建data_seq目录,用于存放需要测试的序列
- 根据tracker_benchmark_v1.0根路径下的anno目录对应的txt文件将OTB100中对应的序列复制到data_seq目录
- 需要注意的是data_seq目录中的序列名必须与anno目录中的txt文件保持严格一直,由于OTB100中序列的命名规则首字母大写,而anno中txt对应文件首字母小写,因此提供如下的转换脚本
clear all;
clc;
%% 确定目录路径
srcPath='./OTB100/';
dstPath='./OTB2015/';
if ~exist(dstPath,'dir')
mkdir(dstPath);
end
%% 读取源目录文件
contents=dir(srcPath);
contents=contents(3:length(contents),:);
%% 处理文件名
for i=1:length(contents)
newName=([lower(contents(i).name(1)) contents(i).name(2:end)]);
mkdir([dstPath newName]);
copyfile([srcPath contents(i).name],[dstPath newName]);
end
1.6 修改测试序列
修改configSeqs.m中的路径为你自己想要测试的序列路径
function seqs=configSeqs
seqVTD={struct('name','soccer','path','./data_seq\soccer\img\','startFrame',1,'endFrame',392,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','matrix','path','./data_seq\matrix\img\','startFrame',1,'endFrame',100,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','ironman','path','./data_seq\ironman\img\','startFrame',1,'endFrame',166,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','deer','path','./data_seq\deer\img\','startFrame',1,'endFrame',71,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','skating1','path','./data_seq\skating1\img\','startFrame',1,'endFrame',400,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','shaking','path','./data_seq\shaking\img\','startFrame',1,'endFrame',365,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','singer1','path','./data_seq\singer1\img\','startFrame',1,'endFrame',351,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','singer2','path','./data_seq\singer2\img\','startFrame',1,'endFrame',366,'nz',4,'ext','jpg','init_rect', [0,0,0,0])};
seqIVT={struct('name','carDark','path','./data_seq\carDark\img\','startFrame',1,'endFrame',393,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','car4','path','./data_seq\car4\img\','startFrame',1,'endFrame',659,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','david','path','./data_seq\david\img\','startFrame',300,'endFrame',770,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','david2','path','./data_seq\david2\img\','startFrame',1,'endFrame',537,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','sylvester','path','./data_seq\sylvester\img\','startFrame',1,'endFrame',1345,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','trellis','path','./data_seq\trellis\img\','startFrame',1,'endFrame',569,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','fish','path','./data_seq\fish\img\','startFrame',1,'endFrame',476,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','mhyang','path','./data_seq\mhyang\img\','startFrame',1,'endFrame',1490,'nz',4,'ext','jpg','init_rect', [0,0,0,0])};
seqOther={struct('name','coke','path','./data_seq\coke\img\','startFrame',1,'endFrame',291,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','bolt','path','./data_seq\bolt\img\','startFrame',1,'endFrame',350,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','boy','path','./data_seq\boy\img\','startFrame',1,'endFrame',602,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','dudek','path','./data_seq\dudek\img\','startFrame',1,'endFrame',1145,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','crossing','path','./data_seq\crossing\img\','startFrame',1,'endFrame',120,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','couple','path','./data_seq\couple\img\','startFrame',1,'endFrame',140,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','football1','path','./data_seq\football1\img\','startFrame',1,'endFrame',74,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','jogging-1','path','./data_seq\jogging-1\img\','startFrame',1,'endFrame',307,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','jogging-2','path','./data_seq\jogging-2\img\','startFrame',1,'endFrame',307,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','doll','path','./data_seq\doll\img\','startFrame',1,'endFrame',3872,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','girl','path','./data_seq\girl\img\','startFrame',1,'endFrame',500,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','walking2','path','./data_seq\walking2\img\','startFrame',1,'endFrame',500,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','walking','path','./data_seq\walking\img\','startFrame',1,'endFrame',412,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','fleetface','path','./data_seq\fleetface\img\','startFrame',1,'endFrame',707,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','freeman1','path','./data_seq\freeman1\img\','startFrame',1,'endFrame',326,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','freeman3','path','./data_seq\freeman3\img\','startFrame',1,'endFrame',460,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','freeman4','path','./data_seq\freeman4\img\','startFrame',1,'endFrame',283,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','david3','path','./data_seq\david3\img\','startFrame',1,'endFrame',252,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','jumping','path','./data_seq\jumping\img\','startFrame',1,'endFrame',313,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','carScale','path','./data_seq\carScale\img\','startFrame',1,'endFrame',252,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','skiing','path','./data_seq\skiing\img\','startFrame',1,'endFrame',81,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','dog1','path','./data_seq\dog1\img\','startFrame',1,'endFrame',1350,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','suv','path','./data_seq\suv\img\','startFrame',1,'endFrame',945,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','motorRolling','path','./data_seq\motorRolling\img\','startFrame',1,'endFrame',164,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','mountainBike','path','./data_seq\mountainBike\img\','startFrame',1,'endFrame',228,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','lemming','path','./data_seq\lemming\img\','startFrame',1,'endFrame',1336,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','liquor','path','./data_seq\liquor\img\','startFrame',1,'endFrame',1741,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','woman','path','./data_seq\woman\img\','startFrame',1,'endFrame',597,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','faceocc1','path','./data_seq\faceocc1\img\','startFrame',1,'endFrame',892,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','faceocc2','path','./data_seq\faceocc2\img\','startFrame',1,'endFrame',812,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','basketball','path','./data_seq\basketball\img\','startFrame',1,'endFrame',725,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','football','path','./data_seq\football\img\','startFrame',1,'endFrame',362,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','subway','path','./data_seq\subway\img\','startFrame',1,'endFrame',175,'nz',4,'ext','jpg','init_rect', [0 0 0 0]),...
struct('name','tiger1','path','./data_seq\tiger1\img\','startFrame',1,'endFrame',354,'nz',4,'ext','jpg','init_rect', [0,0,0,0]),...
struct('name','tiger2','path','./data_seq\tiger2\img\','startFrame',1,'endFrame',365,'nz',4,'ext','jpg','init_rect', [0,0,0,0])};
seqs=[seqVTD,seqIVT,seqOther];
需要注意到这里之后还要将测试序列路径中的多余“_c”删除
1.7 测试tracker_benchmark_v1.0源码
到这里就可以运行tracker_benchmark_v1.0源码,运行顺序configSeqs.m->main_running.m->PerfPlot.m能够得到36张评估图
1.8 配置后的MATLAB源码下载
下载链接:https://pan.baidu.com/s/1bVu4jvTIc9HGjkzw09G16g
提取码:gl3f
参考博客: