-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcheckTracking_Boris_old.m
39 lines (34 loc) · 1.23 KB
/
checkTracking_Boris_old.m
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
34
35
36
37
38
39
function [perror] = checkTracking_Boris_old(truedata, mydata, Nframes)
if nargin < 3
Nframes = truedata.nFrames;
end
trueobjectsnormalobjects = [0 0];
numberofallobjrect = 0;
numberofsmissed = 0;
for iFrame=1:min(Nframes, truedata.nFrames)
trueframe = truedata.Frames(iFrame);
myframe = mydata.Frames(iFrame);
nObjs = trueframe.nObjects;
for iObj = 1:nObjs
trueobj = trueframe.objects(iObj);
trueid = trueobj.id;
if (ischar(trueid))
trueid = str2double(trueid);
end
obj = myframe.objects(iObj);
id = obj.id;
if (ischar(id))
id = str2double(id);
end
if (sum(trueobjectsnormalobjects(:,1) == trueid)==0)&(sum(trueobjectsnormalobjects(:,2) == id)==0)
trueobjectsnormalobjects = [trueobjectsnormalobjects; [trueid,id]];
elseif(trueobjectsnormalobjects(trueobjectsnormalobjects(:,1) == trueid,2) ~= id)
numberofsmissed = numberofsmissed + 1;
elseif(trueobjectsnormalobjects(trueobjectsnormalobjects(:,2) == id,1) ~= trueid)
numberofsmissed = numberofsmissed + 1;
end
numberofallobjrect = numberofallobjrect + 1;
end;
end;
perror = numberofsmissed/numberofallobjrect;
end