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的更多相关文章

  1. 关于视觉跟踪中评价标准的相关记录(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 ...

  2. 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 ...

  3. Silence Removal and End Point Detection MATLAB Code

    转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/08/silence-removal-and-end-point-detection.html ...

  4. plot a critical difference diagram , MATLAB code

    plot a critical difference diagram , MATLAB code 建立criticaldifference函数 function cd = criticaldiffer ...

  5. 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 ...

  6. 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 ...

  7. 支持向量机的smo算法(MATLAB code)

    建立smo.m % function [alpha,bias] = smo(X, y, C, tol) function model = smo(X, y, C, tol) % SMO: SMO al ...

  8. MFCC matlab code

    %function ccc=mfcc(x) %归一化mel滤波器组系数 filename=input('input filename:','s'); [x,fs,bits]=wavread(filen ...

  9. 求平均排序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 ...

随机推荐

  1. Nest js 使用axios模块

    文档 let r = await this.http.get(`https://api.github.com/users/januwA`).toPromise().then(v => v.dat ...

  2. PHP计算显示平均温度、五个最低及最高温度

    <?php $month_temp = "78, 60, 62, 68, 71, 68, 73, 85, 66, 64, 76, 63, 81, 76, 73, 68, 72, 73, ...

  3. Assignments---(贪心)

    Assignments Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  4. react表单的一些小例子

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. MySQL数据库(增删查改)

    创建一个表:create table user( uid varchar(10) , pwd int(10) ); 学生表: create table student( sno varchar(20) ...

  6. Oracle课程档案,第五天

    集合操作 desc job_history:改变历史职位 job_history:历史表 vnion:重复值只保留一个 去除重复值 ★★ vnion all: 把所有重复值保留 不去除重复值★★ in ...

  7. jq1.9.0以上版本不兼容live()解决方法

    最近一个项目里用bootstrap做图形渲染,需要用到jq1.9以上版本,而copy的js代码里用到了live()方法,故两者产生了兼容问题,下面是解决方案: $('#my').on("cl ...

  8. Python2与python3 文件操作关于打开文件

    #首先在python3中操作文件只有一种选择,那就是open() #而在python2中则有两种方式:file()与open() 两者都能够打开文件,对文件进行操作,也具有相似的用法和参数,但是,这两 ...

  9. C++ 11 多线程下std::unique_lock与std::lock_guard的区别和用法

    这里主要介绍std::unique_lock与std::lock_guard的区别用法 先说简单的 一.std::lock_guard的用法 std::lock_guard其实就是简单的RAII封装, ...

  10. Selenium IDE

    Selenium IDE : Selenium IDE作为Firefox浏览器的一款插件,依附于firefox浏览器,打开它的录制功能,它会忠实的记录,你对firefox的操作,并可以回放它所记录的你 ...