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 ...
随机推荐
- v-if和v-show
1.v-if 当值为 true时,显示元素 ,当值为false时,改元素消失------------------(销毁与重建dom) 2.v-show 当值为 true时,显示元素(display:b ...
- xcode工程编译错误之iOS解决CUICatalog: Invalid asset name supplied问题
[问题分析]: 这个问题其实是老问题,产生原因就是因为在使用的时候 [UIImage imageNamed:]时,图片不存在或者传入的图片名为nil. [解决方法]: 添加一个系统断点,来判断如果图片 ...
- vue 安装cli3.0版本,创建项目
注意:Vue CLI需要Node.js版本8.9或更高版本(建议使用8.11.0+). 查看node版本:node -v , 查看npm 版本 npm -v, 1.首先需要安装node.js环境 ...
- Spring Boot事务管理(下)
在上两篇 Spring Boot事务管理(上)和Spring Boot事务管理(中)的基础上介绍注解@Transactional. 5 @Transactional属性 属性 类型 描述 value ...
- python字符串拼接
Python字符串拼接 在Python的实际开发中,很多都需要用到字符串拼接,python中字符串拼接有很多,今天总结一下: 用+符号拼接 用%符号拼接 用join()方法拼接 用format()方法 ...
- sql中遍历字符串
在sql或者存储过程中会需要遍历字符串. ), --如111,222,333,尾部加, ), @Id int, ) set @split = ',' ) begin ,) ,charindex(@sp ...
- bootstrap 下拉菜单自动向上向下弹起
.别人的解决方案 2.别人的解决方案 3.我哒 div class="btn-group" style="margin-top:500px;" > < ...
- 小程序 navigator 无法跳转 tabBar上的页面
解决方法一: navigator 的 open-type 设置为 switchTab 解决方法二: 使用 wx.switchTab({ url: ‘../cart/index’ }) 进行跳转
- 从零开始一起学习SLAM | 给点云加个滤网
对VSLAM和三维重建感兴趣的在计算机视觉life"公众号菜单栏回复"三维视觉"进交流群. 小白:师兄,上次你讲了点云拼接后,我回去费了不少时间研究,终于得到了和你给的参 ...
- cocos2d-x JS 定时器暂停方法
this.scheduleOnce(function(){ this.addChild(Menugobtn);//要暂停执行的代码 }, 10);