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 ...
随机推荐
- Java之JVM监控工具分享
Java之JVM监控工具分享 JVM的基本知识常用的也就是类加载机制,内存区域.分配.OOM,GC,JVM参数调优 几个链接自己看: 内存区域&类加载机制 分配策略&垃圾回收算法.收集 ...
- Spring-Boot数据库密码加密配置
springboot集成mysql/oracle时需要在yml/properties中配置数据库信息,用户名密码是肯定有的,所以就涉及到密码的加密,当然不加密也是可以的,正如某位大佬所说的,不加密就像 ...
- Tomcat部署工程需注意的三点
Tomcat部署工程需注意: 1.如果该服务器是第一安装Tomcat,则各位大人应将该Tomcat的解压文件夹 backup 一份,已被不时之用.2.部署时应当注意修改Tomcat安装目录中conf文 ...
- 微信小程序开发笔记04
今天将小程序的页面进行优化 消除昨天遇到的bug问题. 完成了微信小程序的开发.
- Java中的日期格式转化
package lianxi; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util ...
- 爬虫IP代理中的http与https
之前使用代理IP,构造的proxies一直都是http模式 proxies={"http": "http://{}".format(ip)} 但是今天遇到的网站 ...
- jquery截取地址栏中url参数的值
<script> /*http://127.0.0.9/index.php?s=/Home/Index/fangguan_shuju&zc=2*/ function getQuer ...
- ASP.NET Core 实现跨站登录重定向的新姿势
作为 .NET 程序员,痛苦之一是自从 ASP.NET 诞生之日起直到最新的 ASP.NET Core 都无法直接实现跨站登录重定向(比如访问 https://q.cnblogs.com ,跳转到 h ...
- ping不通,配置dns
vim /etc/resolv.conf nameserver 119.29.29.29 nameserver 182.254.116.116 nameserver 8.8.8.8
- Cardinal and Ordinal Numbers
Cardinal Numbers Table of Cardinal Numbers Cardinal numbers from 1 through 1,000,000 1 one 11 eleven ...