-
Notifications
You must be signed in to change notification settings - Fork 111
/
run_Staple.m
executable file
·41 lines (33 loc) · 1.13 KB
/
run_Staple.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
40
41
function results = run_Staple(seq, res_path, bSaveImage)
% Entry point for the Wu - CVPR2013 benchmark
%% Read params.txt
params = readParams('params.txt');
params.img_files = seq.s_frames;
params.img_path = '';
im = imread(params.img_files{1});
% grayscale sequence? --> use 1D instead of 3D histograms
if(size(im,3)==1)
params.grayscale_sequence = true;
end
region = seq.init_rect;
if(numel(region)==8)
% polygon format (VOT14, VOT15)
[cx, cy, w, h] = getAxisAlignedBB(region);
else % rectangle format (WuCVPR13)
x = region(1);
y = region(2);
w = region(3);
h = region(4);
cx = x+w/2;
cy = y+h/2;
end
% init_pos is the centre of the initial bounding box
params.init_pos = [cy cx];
params.target_sz = round([h w]);
[params, bg_area, fg_area, area_resize_factor] = initializeAllAreas(im, params);
% in runTracker we do not output anything because it is just for debug
params.fout = -1;
% start the actual tracking
results = trackerMain(params, im, bg_area, fg_area, area_resize_factor);
fclose('all');
end