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 ...
随机推荐
- 微信小程序之点赞和取消点赞
wxml代码 <image wx:if="{{collection}}" src="/images/boy.png" bindtap="toCo ...
- mui 滑块开关 进度条 以及如何获取值
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...
- Python学习之旅(九)
Python基础知识(8):集合 集合:由不同元素组成,无序的,不重复的序列 补充知识:可变类型:列表.字典:不可变类型:数字.字符串.元组 使用大括号{}或set()方法定义集合 se=set(&q ...
- css的position,float属性的理解
我们知道,html是按照普通流来加载的,这个时候我们有些需求就不好实现.因此出现了非普通流: 1.普通流:按照顺序正常的排列,长度或不够就往下挤.position默认的static 2.非普通流:脱离 ...
- 算法基础_递归_给定一个数字n,打印出所有的划分等式
问题描述: 给定一个数字n,打印出所有的划分等式 例: n = 3 3 2+1 1+1+1 解题源代码: import java.util.Scanner; /** * 给定数字n,打印出其所有用加法 ...
- 01day
01 cpu 内存 硬盘 操作系统 CPU:中央处理器,相当于人大脑. (运行速度飞机) 内存:临时存储数据. 8g,16g, (高铁) 1,成本高. 2,断电即消 ...
- Luogu 1098 - 字符串的展开 - [字符串操作][模拟]
题目链接:https://www.luogu.org/problemnew/show/P1098 题目描述在初赛普及组的“阅读程序写结果”的问题中,我们曾给出一个字符串展开的例子:如果在输入的字符串中 ...
- Python 学习笔记1 安装和IDE
前面的话 现在随着互联网的快速发展,对测试人员的代码要求也越来越高.有种逐步往全栈开发人员发展的趋势. 越来越多的手工测试被自动化取代. 对于测试人员,学习一门开发语言迫在眉睫. C#, JAVA, ...
- jquery批量提交表单值 和批量设置表单值
$('#frmCustomerConfirmCar').find('[name]').each(function () { var type = $(this)[0].nodeName.toLower ...
- Linux 中如何用源代码安装软件,以及如何卸载它
https://www.linuxidc.com/Linux/2017-12/149839.htm http://www.openssh.com/ http://www.openssh.com/por ...