Matlab Code for Visualize the Tracking Results of OTB100 dataset
Matlab Code for Visualize the Tracking Results of OTB100 dataset
2018-11-12 17:06:21
%把所有tracker的结果画在一张图上,结果保存在当前目录下的trackingResultsDisplay下
clc; close all; clear all;
dataPath = 'C:\Users\WANG XIAO\Desktop\Tracking_evaluation\OTB100_benchmark\Benchmark\';
trackerResultsPath='C:\Users\WANG XIAO\Desktop\Tracking_evaluation\PlotErr_OTBdataset\BBresults\';
sequencePath=dataPath;
saveBasePath='C:\Users\WANG XIAO\Desktop\demo_tracking_results\';
sequences=dir(dataPath);
sequences=sequences(3:end);
sequences={sequences.name}; tracker={ 'CSRDCF', 'SRDCF', 'ECO', 'CCOT', 'pyMDNetBaseline' }; % edgeColor={'r', 'g', 'b', 'y', 'k', 'm', 'c', 'g', 'b', 'y', 'k', 'm'};
edgeColor(:,:,1)=[1,0,0]; edgeColor(:,:,2)=[0,0,1]; edgeColor(:,:,3)=[0,1,0];
edgeColor(:,:,4)=[0,1,1]; edgeColor(:,:,5)=[1,0,1]; edgeColor(:,:,6)=[0,0,0];
edgeColor(:,:,7)=[1,1,1]; edgeColor(:,:,8)=[0,1,0]; edgeColor(:,:,9)=[0,1,1];
edgeColor(:,:,10)=[1,0,1]; edgeColor(:,:,11)=[0,0,0]; edgeColor(:,:,12)=[1,0.5,0];
edgeColor(:,:,13)=[0.5,0.5,0]; edgeColor(:,:,14)=[0,0,1]; edgeColor(:,:,15)=[0,1,0];
lineStyle={'-','-','-','-','-','-','-',}; %% ####################################################
seqIndexList = {51, 64, 72}; %% set the video index you want to shown. for seqIndex=1:length(seqIndexList)
trackerResult=[];
sequence=sequences{seqIndexList{seqIndex}}; if(isdir(saveBasePath)==0),
mkdir(saveBasePath);
end savingPath=[saveBasePath sequence '/'];
if(isdir(savingPath)==0),
mkdir(savingPath);
mkdir([savingPath 'v/']);
mkdir([savingPath 'i/']); end
savingPath; for trackerIndex=1:length(tracker),
try
trackerResult(:,:,trackerIndex)=dlmread([trackerResultsPath tracker{trackerIndex} '_' sequence '.txt']);
catch
trackerResult(:,:,trackerIndex)=dlmread([trackerResultsPath sequence '_' tracker{trackerIndex} '.txt']);
end end frames_v=dir([sequencePath sequence '/img/*.jpg']);
frames_i=dir([sequencePath sequence '/img/*.jpg']);
if(isempty(frames_v)==1),
frames_v=dir([sequencePath sequence '/img/*.jpg']);
end if(isempty(frames_i)==1),
frames_i=dir([sequencePath sequence '/img/*.jpg']);
end frames_v={frames_v.name};
frames_i={frames_i.name}; bb=[ trackerResult(:,1,:), trackerResult(:,2,:) , trackerResult(:,3,:), trackerResult(:,4,:) ] ; % for the visible images
for frameIndex=1:length(frames_v),
im=imread([sequencePath sequence '/img/' frames_v{frameIndex}]);
imshow(uint8(im));
for trackerIndex=1:length(tracker),
if ~isempty(strfind(tracker{trackerIndex},'_i'))==1, continue;
end
tracker{trackerIndex} disp(['==>> frameIndex: ', num2str(frameIndex), ' ==>> trackerIndex: ', num2str(trackerIndex)]);
disp(['==>> bb: ', num2str(size(bb))]);
bbtemp=bb(frameIndex,:,trackerIndex); if bbtemp(3)<=0,
bbtemp(3)=1;
bb(frameIndex,:,trackerIndex)=bbtemp;
end
if bbtemp(4)<=0,
bbtemp(4)=1;
bb(frameIndex,:,trackerIndex)=bbtemp;
end if(bb(frameIndex,1,trackerIndex)>0||bb(frameIndex,2,trackerIndex)>0||...
bb(frameIndex,3,trackerIndex)>0||bb(frameIndex,4,trackerIndex)>0),
rectangle('Position',bb(frameIndex,:,trackerIndex),'LineWidth',2,'EdgeColor',edgeColor(:,:,trackerIndex),'LineStyle',lineStyle{trackerIndex});
end
end hold on;
text(10, 30, strcat('#',num2str(frameIndex)), 'Color','y', 'FontWeight','bold', 'FontSize',30);
set(gca,'position',[0 0 1 1]);
pause(0.00001);
hold off;
imgName=sprintf('%04d.jpg',frameIndex);
saveas(gca,[savingPath 'v/' imgName]);
t1=imread([savingPath 'v/' imgName]);
t1=imresize(t1,[272 640]);
% imwrite(t1, [savingPath 'v/' imgName]); end end
Matlab Code for Visualize the Tracking Results of OTB100 dataset的更多相关文章
- 关于视觉跟踪中评价标准的相关记录(The Evaluation of Visual Tracking Results on OTB-100 Dataset)
关于视觉跟踪中评价标准的相关记录(The Evaluation of Visual Tracking Results on OTB-100 Dataset) 2018-01-22 21:49:17 ...
- Matlab Script to pre-process UAV123 tracking dataset
Matlab Script to pre-process UAV123 tracking dataset 2019-11-08 09:43:11 Official project page: http ...
- Silence Removal and End Point Detection MATLAB Code
转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/08/silence-removal-and-end-point-detection.html ...
- plot a critical difference diagram , MATLAB code
plot a critical difference diagram , MATLAB code 建立criticaldifference函数 function cd = criticaldiffer ...
- Compute Mean Value of Train and Test Dataset of Caltech-256 dataset in matlab code
Compute Mean Value of Train and Test Dataset of Caltech-256 dataset in matlab code clc;imPath = '/ho ...
- save tracking results into csv file for oxuva long-term tracking dataset (from txt to csv)
save tracking results into csv file for oxuva long-term tracking dataset (from txt to csv) 2019-10-2 ...
- 支持向量机的smo算法(MATLAB code)
建立smo.m % function [alpha,bias] = smo(X, y, C, tol) function model = smo(X, y, C, tol) % SMO: SMO al ...
- MFCC matlab code
%function ccc=mfcc(x) %归一化mel滤波器组系数 filename=input('input filename:','s'); [x,fs,bits]=wavread(filen ...
- 求平均排序MATLAB code
A0=R(:,1:2:end); for i=1:17 A1=A0(i,:); p=sort(unique(A1)); for j=1:length(p) Rank0(A1==p(j))=j; end ...
随机推荐
- 如何开始学习ADF和Jdeveroper 11g
作为第一篇博客,先给一些资料可以帮助初学者开始学习ADF和Jdeveloper11g 1.首先毫无疑问,你要懂java语言, 可以看看Thinking In Java, 或者原来sun的网上的一些文档 ...
- C++ 中文拼音排序方法。
参考文档:http://zisxks.com/2013/10/25/sort-Chinese-characters-in-cpp/ 采用locate.注意事项:排序的名字,如果出现某一个人,出现在顶上 ...
- Oracle课程档案,第十四天
备份数据文件:SQL> select file_id, file_name from dba_data_files; backup:备用(备份) datafile:数据文件 backup tab ...
- 洛谷P3808 【模板】AC自动机(简单版)
题目背景 这是一道简单的AC自动机模板题. 用于检测正确性以及算法常数. 为了防止卡OJ,在保证正确的基础上只有两组数据,请不要恶意提交. 管理员提示:本题数据内有重复的单词,且重复单词应该计算多次, ...
- The way to unwind the stack on Linux EABI
I. probe the stack frame structure The original idea is to unwind the function call stack according ...
- Web开发——HTML基础(HTML表单/下拉列表/多行输入)
参考: 参考:http://www.w3school.com.cn/html/html_forms.asp 目录: 1.<form> 元素 1.1 <input> 元素(输入属 ...
- android AsyncTask异步任务(笔记)
AsyncTask是一个专门用来处理后台进程与UI线程的工具.通过AsyncTask,我们可以非常方便的进行后台线程和UI线程之间的交流. 那么AsyncTask是如何工作的哪. AsyncTask拥 ...
- Oracle实用操作
查询用户下所有表:select * from tab; 删除表: drop table 表名; 但是删除表后还是会查询到BIN开头的垃圾表,drop后的表存在于回收站: 清空回收站所有表: purg ...
- Date Calendar
1 毫秒值概念 时间和日期的计算,必须依赖毫秒值获取当前日期的毫秒值:System.currentTimeMillis() 返回值long类型参数, 时间原点:公元1970年1月1日,午夜0:00:0 ...
- ndarray的用法总结
#发现ndarray的一维,二维都可以用[i][j], 它们都是下标索引的连用, 比如j表示第j个元素;#二维ndarray可以用[m, n]来进行行列的操作,类似matlab中的用法.取某一列是[: ...