代码下载地址:

https://github.com/bertinetto/staple

由于Staple运行需要特定的数据格式,本文把原工程目录runTracker.m简单修改便于测试,改动不大。

1、运行测试自带视频例子

在工程目录下新建run_example1.m文件

function run_example1
% RUN_TRACKER  is the external function of the tracker - does initialization and calls trackerMain%% Read params.txtparams = readParams('params.txt');%% load video infostart_frame=1;                      %开始帧sequence_path = ['vot15_ball1/'];   %视频路径总路径img_path = [sequence_path 'imgs/']; %图片路径%% Read filestext_files = dir([sequence_path '*_frames.txt']);f = fopen([sequence_path text_files(1).name]);frames = textscan(f, '%f,%f');    %一共多少帧if exist('start_frame')frames{1} = start_frame;elseframes{1} = 1;endfclose(f);params.bb_VOT = csvread([sequence_path 'groundtruth.txt']);region = params.bb_VOT(frames{1},:);%%%%%%%%%%%%%%%%%%%%%%%%%% read all the frames in the 'imgs' subfolderdir_content = dir([sequence_path 'imgs/']);% skip '.' and '..' from the countn_imgs = length(dir_content) - 2;img_files = cell(n_imgs, 1);for ii = 1:n_imgsimg_files{ii} = dir_content(ii+2).name;endimg_files(1:start_frame-1)=[];im = imread([img_path img_files{1}]);% is a grayscale sequence ?if(size(im,3)==1)params.grayscale_sequence = true;endparams.img_files = img_files;params.img_path = img_path;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%if(numel(region)==8)% polygon format[cx, cy, w, h] = getAxisAlignedBB(region);elsex = region(1);y = region(2);w = region(3);h = region(4);cx = x+w/2;cy = y+h/2;end% init_pos is the centre of the initial bounding boxparams.init_pos = [cy cx];params.target_sz = round([h w]);[params, bg_area, fg_area, area_resize_factor] = initializeAllAreas(im, params);if params.visualizationparams.videoPlayer = vision.VideoPlayer('Position', [100 100 [size(im,2), size(im,1)]+30]);end% in runTracker we do not output anythingparams.fout = -1;% start the actual trackingtrackerMain(params, im, bg_area, fg_area, area_resize_factor);fclose('all');
end

2、运行run_example1.m

3、跑OTB数据集

在工程目录下新建run_example2.m文件

function run_example2
% RUN_TRACKER  is the external function of the tracker - does initialization and calls trackerMain%% Read params.txtparams = readParams('params.txt');%% load video infovideos = {'David','Basketball', 'Bolt'};start_frame=1;
%     videos = {'Basketball', 'Bolt', 'Boy', 'Car4', 'CarDark', 'CarScale', ...
%     'Coke', 'Couple', 'Crossing', 'David2', 'David3', 'David', 'Deer', ...
%     'Dog1', 'Doll', 'Dudek', 'Faceocc1', 'Faceocc2', 'Fish', 'Fleetface', ...
%     'Football', 'Football1', 'Freeman1', 'Freeman3', 'Freeman4', 'Girl', ...
%     'Ironman', 'Jogging_1', 'Jumping', 'Lemming', 'Liquor', 'Matrix', ...
%     'Mhyang', 'MotorRolling', 'MountainBike', 'Shaking', 'Singer1', ...
%     'Singer2', 'Skating1', 'Skiing', 'Soccer', 'Subway', 'Suv', 'Sylvester', ...
%     'Tiger1', 'Tiger2', 'Trellis', 'Walking', 'Walking2', 'Woman'};
for s=1:numel(videos)sequence_path = ['D:/Datasets/OTB100/',videos{s},'/'];   %视频路径总路径img_path = [sequence_path 'img/']; %图片路径params.bb_VOT = csvread([sequence_path 'groundtruth_rect.txt']);region = params.bb_VOT(start_frame,:);%%%%%%%%%%%%%%%%%%%%%%%%%% read all the frames in the 'imgs' subfolderdir_content = dir([sequence_path 'img/']);% skip '.' and '..' from the countn_imgs = length(dir_content) - 2;img_files = cell(n_imgs, 1);for ii = 1:n_imgsimg_files{ii} = dir_content(ii+2).name;endimg_files(1:start_frame-1)=[];im = imread([img_path img_files{1}]);% is a grayscale sequence ?if(size(im,3)==1)params.grayscale_sequence = true;endparams.img_files = img_files;params.img_path = img_path;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%if(numel(region)==8)% polygon format[cx, cy, w, h] = getAxisAlignedBB(region);elsex = region(1);y = region(2);w = region(3);h = region(4);cx = x+w/2;cy = y+h/2;end% init_pos is the centre of the initial bounding boxparams.init_pos = [cy cx];params.target_sz = round([h w]);[params, bg_area, fg_area, area_resize_factor] = initializeAllAreas(im, params);if params.visualizationparams.videoPlayer = vision.VideoPlayer('Position', [100 100 [size(im,2), size(im,1)]+30]);end% in runTracker we do not output anythingparams.fout = -1;% start the actual trackingtrackerMain(params, im, bg_area, fg_area, area_resize_factor);fclose('all');
end
end

更改第七行为你想测试的OTB视频序列名称

更改第十八行为数据集所在路径

4、运行run_example2.m

5、跑VOT数据集

在工程目录下新建run_example3.m文件

function run_example3
% RUN_TRACKER  is the external function of the tracker - does initialization and calls trackerMain%% Read params.txtparams = readParams('params.txt');%% load video infovideos = {'bag','ball1','ball2'};start_frame=1;
%     videos = {'bag','ball1','ball2','basketball','birds1','birds2','blanket','bmx','bolt1',...
%               'bolt2','book','butterfly','car1','car2','crossing','dinosaur','fernando','fish1',...
%               'fish2','fish3','fish4','girl','glove','godfather','graduate','gymnastics1',...
%               'gymnastics2','gymnastics3','gymnastics4','hand','handball1','handball2',...
%               'helicopter','iceskater1','iceskater2','leaves','marching','matrix','motocross1',...
%               'motocross2','nature','octopus','pedestrian1','pedestrian2','rabbit','racing',...
%               'road','shaking','sheep','singer1','singer2','singer3','soccer1','soccer2',...
%               'soldier','sphere','tiger','traffic','tunnel','wiper'};
for s=1:numel(videos)sequence_path = ['D:/Datasets/vot2016/',videos{s},'/'];   %视频路径总路径img_path = sequence_path; %图片路径params.bb_VOT = csvread([img_path 'groundtruth.txt']);region = params.bb_VOT(start_frame,:);%%%%%%%%%%%%%%%%%%%%%%%%%% read all the frames in the 'imgs' subfolderdir_content = dir(sequence_path);% skip '.' and '..' from the countn_imgs = length(dir_content) - 2;img_files = cell(n_imgs, 1);for ii = 1:n_imgsimg_files{ii} = dir_content(ii+2).name;endimg_files(1:start_frame-1)=[];im = imread([img_path img_files{1}]);% is a grayscale sequence ?if(size(im,3)==1)params.grayscale_sequence = true;endparams.img_files = img_files;params.img_path = img_path;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%if(numel(region)==8)% polygon format[cx, cy, w, h] = getAxisAlignedBB(region);elsex = region(1);y = region(2);w = region(3);h = region(4);cx = x+w/2;cy = y+h/2;end% init_pos is the centre of the initial bounding boxparams.init_pos = [cy cx];params.target_sz = round([h w]);[params, bg_area, fg_area, area_resize_factor] = initializeAllAreas(im, params);if params.visualizationparams.videoPlayer = vision.VideoPlayer('Position', [100 100 [size(im,2), size(im,1)]+30]);end% in runTracker we do not output anythingparams.fout = -1;% start the actual trackingtrackerMain(params, im, bg_area, fg_area, area_resize_factor);fclose('all');
end
end

更改第七行为你想测试的VOT视频序列名称

更改第十八行为数据集所在路径

6、运行run_example3.m

CVPR2016跟踪算法Staple的配置(Staple: Complementary Learners for Real-Time Tracking)相关推荐

  1. PAMI2018跟踪算法HCFTstar的配置(Robust Visual Tracking via Hierarchical Convolutional Features)

    文章和代码下载地址: HCFTstar: Chao Ma, Jia-Bin Huang, Xiaokang Yang, Ming-Hsuan Yang. "Robust Visual Tra ...

  2. CVPR2021跟踪算法TransT的配置(Transformer Tracking)

    1.论文下载地址 TransT: Transformer Tracking.[paper] 2.代码下载地址 https://github.com/chenxin-dlut/TransT 3.建立虚拟 ...

  3. CVPR2018跟踪算法VITAL的配置(VITAL: VIsual Tracking via Adversarial Learning)

    工程介绍地址: VITAL 代码下载地址: https://github.com/ybsong00/Vital_release 一.跟踪测试 1.运行compile_matconvnet.m编译mat ...

  4. PAMI2012跟踪算法TLD的配置(Tracking-learning-detection)

    代码下载地址: https://github.com/zk00006/OpenTLD 1.打开compile.m更改OpenCV路径 2.运行compile.m 可能遇到错误: 原因:OpenCV版本 ...

  5. CVPR2021跟踪算法STMTrack的配置(Template-free Visual Tracking with Space-time Memory Networks)

    1.论文下载地址 STMTrack: Template-free Visual Tracking with Space-time Memory Networks CVPR (2021). [paper ...

  6. OTB数据集和VOT数据集融合跟踪算法接口示例

    OTB数据集和VOT数据集自己存数据接口参考代码: 一.OTB数据集(不使用tracker_benchmark_v1.0) 1.OTB数据结果最基本的格式 type为目标框类型: res为目标框的所在 ...

  7. 目标跟踪算法--Staple: Complementary Learners for Real-Time Tracking

    文章下载链接:文章下载链接 代码下载链接:Staple代码 -------------------------------------------- 今天要讲的这篇文章也是基于相关滤波器(不懂相关滤波 ...

  8. Staple 跟踪: Complementary Learners for Real-Time Tracking

    目标跟踪算法--Staple: Complementary Learners for Real-Time Tracking 小小菜鸟一只 2017-03-25 09:26:42  15110  收藏  ...

  9. STAPLE目标跟踪算法(C++ /OpenCV)

    简介 结合梯度特征HOG及颜色特征的实时跟踪算法,速度可以达到80FPS. 摘要 近些年来,基于相关滤波跟踪器的算法得到了很大的改进,已经能够达到很好的跟踪效果,14年的KCF,15年的SRDCF.H ...

最新文章

  1. 用sed 给文本文件加行号
  2. adodb.RecordSet的属性和方法
  3. AI 场景的价值体现——视觉 AI 技术落地实践
  4. MyBatis 缓存详解-开启二级缓存的方法
  5. 一个女孩子对老公/男朋友的要求
  6. EntityFramework实体默认值遇到Oracle自增主键
  7. js 中meta 移除head_JS函数和winform函数之间的相互调用
  8. python怎么矩阵的秩_python – 从numpy或matlab中的满秩非矩形矩阵中获取可逆方阵...
  9. 第二章、Linux操作系统及常用命令
  10. Linux系统下i350网卡固件更新说明
  11. [蓝桥杯-138译码器和74hc573锁存器的关系]
  12. 计算机微信开发中期检查表,毕业论文(设计)-中期检查报告(范文)61页
  13. 【晶体管电路设计】五、渥尔曼电路设计
  14. 操作系统 进程通信方式
  15. 呷哺呷哺的中年危机与贺光启的囚徒困境
  16. 电脑自带的应用商店连接不到服务器,win10应用商店无法连接服务器最佳解决方法...
  17. 致我们失去但美好回忆的青春
  18. Oracle新建的用户看不到表,oracle中用命令行新建的用户没法建表
  19. Dropout和BN(层归一化)详解
  20. mysql 实例名是什么意思_mysql 实例是什么意思?

热门文章

  1. yii2手动添加插件PHPExcel
  2. 利用Python中的tkinter和MyQR制作个性二维码转换器
  3. 你的电竞快感它的专属缔造 这款蓝牙音箱有型又有范儿
  4. 「Linux」C++后台开发面试总结(献给进击BAT的你)
  5. 达梦数据库创建dblink
  6. dataframe保存为txt_PDF怎么转换为PPT?PDF秒转PPT秘技
  7. 面向对象思想、特征等
  8. 自己在“在线打字系统”完成的一次打字成绩截图记录。
  9. 如何将word的内容提取出来转成txt
  10. 电子制作:具有固定输出电压的稳压电源电路的制作