March 2020
Intermediate to advanced
366 pages
9h 8m
English
Now, geared with our model, let's get our hands dirty and write a class that handles all this magic. We are going to write a custom class that will use cv2.KalmanFilter as a Kalman filter, but we will add some helper attributes to be able to keep track of each object.
First, let's take a look at the initialization of the class, where we will set up our Kalman filter by passing the state model, transition matrix, and initial parameters:
class KalmanBoxTracker: def __init__(self, bbox, label):