-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathtracker.py
More file actions
64 lines (45 loc) · 1.49 KB
/
tracker.py
File metadata and controls
64 lines (45 loc) · 1.49 KB
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
__author__ = "Jens Honer"
__copyright__ = "Copyright 2018, Jens Honer Tracking Toolbox"
__email__ = "-"
__license__ = "mit"
__version__ = "1.0"
__status__ = "Prototype"
import numpy as np
from datatypes import dt_bbox
class SingleTargetTracker(object):
"""
Tracker base class.
Features the basic steps : step, prediction, correction, reduction, extraction.
Attributes
----------
_uc update count
_epsilon numerical constant
_min_log_prob numerical constant to limit logarithmic probability
_dt step time difference
_steps number of steps to be processed
_z_flat flat measurement list
_log_lik log likelihood matrix
_dt_bbox dtype for the bounding box extraction
"""
def __init__(self, **kwargs):
self._uc = 0
self._epsilon = kwargs.get('epsilon', 1e-9)
self._min_log_prob = kwargs.get('min_log_prob', -700.0)
self._dt = kwargs.get('dt')
self._steps = kwargs.get('steps')
self._z_flat = np.zeros(0, dtype=np.dtype([]))
self._log_lik = self._min_log_prob * np.ones(self._steps, dtype='f8')
self._dt_bbox = dt_bbox
def step(self, z):
self._uc += 1
self.predict()
self.correct(z)
self.reduce()
def predict(self):
pass
def correct(self, z):
raise NotImplementedError
def reduce(self):
pass
def extract(self):
raise NotImplementedError