-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAccuracy.m
More file actions
33 lines (27 loc) · 800 Bytes
/
Copy pathAccuracy.m
File metadata and controls
33 lines (27 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function [ErrorDis, Acc] = Accuracy(RealValue, EstimatedValue, Scale)
% Input:
% RealValue - The real value calibrated by people
% EstimatedValue - The estimated value, which is the output of learning models
% Scale - The scale of pixel and distance
%
% Output:
% ErrorDis - Error distance, here is 1 to 10 meters
% Acc - Accuracy under different ErrorDis
ErrorDis = [1:1:10]';
Acc = zeros(10,1);
[m n] = size(RealValue);
Distance = zeros(m,1);
for i=1:1:m
Distance(i) = norm(RealValue(i,:) - EstimatedValue(i,:));
end
Distance = Distance / Scale;
[p q] = size(ErrorDis);
for i=1:1:p
for j=1:1:m
if Distance(j) < ErrorDis(i)
Acc(i) = Acc(i) + 1;
end
end
Acc(i) = Acc(i) / m;
end
end