forked from zhxing001/code_of_paper_about_tracking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tracker.m
41 lines (31 loc) · 1.83 KB
/
run_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
% run_tracker.m
close all;
% clear all;
%choose the path to the videos (you'll be able to choose one with the GUI)
base_path = 'sequences/';
%parameters according to the paper
params.padding = 1.0; % extra area surrounding the target
params.output_sigma_factor = 1/16; % spatial bandwidth (proportional to target)
params.sigma = 0.2; % gaussian kernel bandwidth
params.lambda = 1e-2; % regularization (denoted "lambda" in the paper)
params.learning_rate = 0.075; % learning rate for appearance model update scheme (denoted "gamma" in the paper)
params.compression_learning_rate = 0.15; % learning rate for the adaptive dimensionality reduction (denoted "mu" in the paper)
params.non_compressed_features = {'gray'}; % features that are not compressed, a cell with strings (possible choices: 'gray', 'cn')
params.compressed_features = {'cn'}; % features that are compressed, a cell with strings (possible choices: 'gray', 'cn')
params.num_compressed_dim = 2; % the dimensionality of the compressed features
params.visualization = 1;
%ask the user for the video
video_path = choose_video(base_path);
if isempty(video_path), return, end %user cancelled
[img_files, pos, target_sz, ground_truth, video_path] = ...
load_video_info(video_path);
params.init_pos = floor(pos) + floor(target_sz/2);
params.wsize = floor(target_sz);
params.img_files = img_files;
params.video_path = video_path;
[positions, fps] = color_tracker(params);
% calculate precisions
[distance_precision, PASCAL_precision, average_center_location_error] = ...
compute_performance_measures(positions, ground_truth);
fprintf('Center Location Error: %.3g pixels\nDistance Precision: %.3g %%\nOverlap Precision: %.3g %%\nSpeed: %.3g fps\n', ...
average_center_location_error, 100*distance_precision, 100*PASCAL_precision, fps);