方法采用devkit
先用一个数据集测试(ETH-Bahnhof)默认是400个检测
我们生成的文件是(400)
默认的devkit中有1000帧
可以看出数据完全不同,测试成功。
生成方法是:
clear all;
close all;
results = load('/home/qi/projects/changeWorks/CMOT_HCF5/Results/cmot_KCF_tracking_results.mat');
cpos = results.all_mot.cpos;
lpos = results.all_mot.lpos;
fprintf('%d\n',size(lpos{1}));
lab = results.all_mot.lab;
size = results.all_mot.size;
num =1;
for fr = 1:400
fprintf('fr:%d\n',fr);
l_t = lpos{fr}; % left_top corner
w_h = size{fr}; % the width and height of the target
label = lab{fr};
for i = 1:length(label)
dres.fr(num)= fr;
dres.id(num) = label(i);
dres.x(num) = l_t(1,i);
dres.y(num) = l_t(2,i);
dres.w(num)= w_h(1,i);
dres.h(num) = w_h(2,i);
num = num + 1;
end
end
num = max(dres.id);
% filename = '/home/qi/projects/changeWorks/CMOT_HCF5/Results/ETH-Bahnhof.txt';
filename = '/home/qi/projects/changeWorks/CMOT_HCF5/Results/ETH-Bahnhof.txt';
if exist(filename,'file')
delete(filename);
end
fid = fopen(filename, 'w');
N = numel(dres.x);
for i = 1:N
fprintf(fid, '%d,%d,%g,%g,%g,%g,%d,%d,%d,%d\n', ...
dres.fr(i), dres.id(i), dres.x(i), dres.y(i), dres.w(i), dres.h(i), -1, -1, -1, -1);
end
fclose(fid);