MCPcopy Create free account
hub / github.com/abewley/sort / __init__

Method __init__

sort.py:99–121  ·  view source on GitHub ↗

Initialises a tracker using initial bounding box.

(self,bbox)

Source from the content-addressed store, hash-verified

97 """
98 count = 0
99 def __init__(self,bbox):
100 """
101 Initialises a tracker using initial bounding box.
102 """
103 #define constant velocity model
104 self.kf = KalmanFilter(dim_x=7, dim_z=4)
105 self.kf.F = np.array([[1,0,0,0,1,0,0],[0,1,0,0,0,1,0],[0,0,1,0,0,0,1],[0,0,0,1,0,0,0], [0,0,0,0,1,0,0],[0,0,0,0,0,1,0],[0,0,0,0,0,0,1]])
106 self.kf.H = np.array([[1,0,0,0,0,0,0],[0,1,0,0,0,0,0],[0,0,1,0,0,0,0],[0,0,0,1,0,0,0]])
107
108 self.kf.R[2:,2:] *= 10.
109 self.kf.P[4:,4:] *= 1000. #give high uncertainty to the unobservable initial velocities
110 self.kf.P *= 10.
111 self.kf.Q[-1,-1] *= 0.01
112 self.kf.Q[4:,4:] *= 0.01
113
114 self.kf.x[:4] = convert_bbox_to_z(bbox)
115 self.time_since_update = 0
116 self.id = KalmanBoxTracker.count
117 KalmanBoxTracker.count += 1
118 self.history = []
119 self.hits = 0
120 self.hit_streak = 0
121 self.age = 0
122
123 def update(self,bbox):
124 """

Callers

nothing calls this directly

Calls 1

convert_bbox_to_zFunction · 0.85

Tested by

no test coverage detected