代码拉取完成,页面将自动刷新
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('Number','off', 'Name',['Precisions - ' title])
figure(2)
plot(precisions, 'k-', 'LineWidth',2)
xlabel('Threshold'), ylabel('Precision')
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。