-
Notifications
You must be signed in to change notification settings - Fork 5
/
create_fclt_tracker.m
83 lines (66 loc) · 2.85 KB
/
create_fclt_tracker.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
function tracker = create_fclt_tracker(img, init_bbox, init_params)
if nargin < 3
init_params = read_default_fclt_parameters();
end
% localizer
localizer_params = read_default_csr_parameters();
localizer_params.estimate_scale = false;
localizer = create_csr_tracker(img, init_bbox, localizer_params);
center = localizer.c;
% scale filter
scale_params = read_default_scale_params();
scale_estimator = create_dsst_scale(scale_params, img, center, ...
localizer.base_target_sz, localizer.template_size);
% detector
detector_params = read_default_csr_parameters();
detector_params.estimate_scale = false;
detector = create_csr_tracker(img, init_bbox, detector_params);
% filter for detector
H = detector.H;
% tracker structure
tracker.localizer = localizer;
tracker.scale_estimator = scale_estimator;
tracker.c = center;
tracker.bb = localizer.bb;
tracker.img_prev = img;
% for long-term component
tracker.resp_budg_sz = init_params.resp_budg_sz;
tracker.resp_budg = [];
tracker.resp_norm = 0;
tracker.lt_state = 1; % 1-track, 2-lost
tracker.redetect = init_params.redetect;
tracker.h_weights = 1;
tracker.h_detector = [];
tracker.detect_failure = init_params.detect_failure;
tracker.detect_recover = init_params.detect_recover;
tracker.detector_window_type = init_params.detector_window_type;
tracker.detector_window_param = init_params.detector_window_param;
tracker.det_weights = init_params.det_weights;
% detector filter properties
tracker.detector.template_size = detector.template_size;
tracker.detector.rescale_template_size = detector.rescale_template_size;
tracker.detector.rescale_ratio = detector.rescale_ratio;
tracker.detector.base_target_sz = detector.base_target_sz;
tracker.detector.cell_size = detector.cell_size;
tracker.detector.feature_type = detector.feature_type;
tracker.detector.w2c = detector.w2c;
tracker.detector.window = detector.window;
tracker.skip_check_beginning = init_params.skip_check_beginning;
tracker.currentScaleFactor = scale_estimator.currentScaleFactor;
tracker.last_scale_factor = scale_estimator.currentScaleFactor;
tracker.frame = 1;
tracker.last_ok = 1;
tracker.detection_filter_created = false;
% detection scales
tracker.det_scales = init_params.det_scales;
tracker.det_scale_idx = 1;
% detector updates frequencies
tracker.detector_temporal = init_params.detector_temporal;
tracker.update_counter = 1;
tracker.H_history_budget = {};
for i=1:numel(tracker.detector_temporal)
tracker.H_history_budget{i} = H;
end
tracker.det_filter_idx = numel(tracker.H_history_budget);
tracker.use_mex = init_params.use_mex;
end % endfunction