-
Notifications
You must be signed in to change notification settings - Fork 18
/
updateAssignedTracks.m
34 lines (31 loc) · 1.18 KB
/
updateAssignedTracks.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
% function updateAssignedTracks(assignments,centroids, bboxes)
% updates each assigned track with the corresponding detection
% Inputs:
% assignments: array
% centroids: array
% bboxes: array
% Outputs:
%
function updateAssignedTracks(assignments,centroids, bboxes)
global obj;
global tracks;
numAssignedTracks = size(assignments, 1);
for i = 1:numAssignedTracks
trackIdx = assignments(i, 1);
detectionIdx = assignments(i, 2);
centroid = centroids(detectionIdx, :);
bbox = bboxes(detectionIdx, :);
% Correct the estimate of the object's location
% using the new detection.
tracks(trackIdx).particles= pfCorrect(tracks(trackIdx).particles, centroid);
% Replace predicted bounding box with detected
% bounding box.
tracks(trackIdx).bbox = bbox;
% Update track's age.
tracks(trackIdx).age = tracks(trackIdx).age + 1;
% Update visibility.
tracks(trackIdx).totalVisibleCount = ...
tracks(trackIdx).totalVisibleCount + 1;
tracks(trackIdx).consecutiveInvisibleCount = 0;
end
end