February 2020
Intermediate to advanced
372 pages
9h 26m
English
As usual, our main loop's primary role is to capture and process frames, until the user hits the Esc key. The processing of each frame – including 3D tracking and AR drawing – is delegated to a helper method called _track_object, which we will examine later, in the Tracking the image in 3D section. The main loop also has a secondary role: that is, to perform timekeeping by measuring the frame rate and updating the Kalman filter's transition matrix accordingly. This update is delegated to another helper method, _init_kalman_transition_matrix, which we will examine in the Initializing and applying the Kalman filter section. With these roles in mind, we can implement the main loop in the run method as follows:
def ...
Read now
Unlock full access