1 Star 6 Fork 2

wycjl / kcf_matlab_apce

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
precision_plot.m 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
wycjl 提交于 2020-05-14 11:37 . 第一次提交
function precisions = precision_plot(positions, ground_truth, title, show)
%PRECISION_PLOT
% Calculates precision for a series of distance thresholds (percentage of
% frames where the distance to the ground truth is within the threshold).
% The results are shown in a new figure if SHOW is true.
%
% Accepts positions and ground truth as Nx2 matrices (for N frames), and
% a title string.
%
% Joao F. Henriques, 2014
% http://www.isr.uc.pt/~henriques/
max_threshold = 50; %used for graphs in the paper
precisions = zeros(max_threshold, 1);
if size(positions,1) ~= size(ground_truth,1),
% fprintf('%12s - Number of ground truth frames does not match number of tracked frames.\n', title)
%just ignore any extra frames, in either results or ground truth
n = min(size(positions,1), size(ground_truth,1));
positions(n+1:end,:) = [];
ground_truth(n+1:end,:) = [];
end
%calculate distances to ground truth over all frames
distances = sqrt((positions(:,1) - ground_truth(:,1)).^2 + ...
(positions(:,2) - ground_truth(:,2)).^2);
distances(isnan(distances)) = [];
%compute precisions
for p = 1:max_threshold,
precisions(p) = nnz(distances <= p) / numel(distances);
end
%plot the precisions
if show == 1,
figure('Name',['Precisions - ' title])
plot(precisions, 'k-', 'LineWidth',2)
xlabel('Threshold'), ylabel('Precision')
end
end
Matlab
1
https://gitee.com/19910509/kcf_matlab_apce.git
git@gitee.com:19910509/kcf_matlab_apce.git
19910509
kcf_matlab_apce
kcf_matlab_apce
master

搜索帮助