Tutorial

Table Of Contents
89
Process explanation: In order to improve the frame rate, we separate the analysis task of the video
frame from the process of acquisition and display, and place it in a background thread to execute and generate
drawing information.
We change the complete code of camera_opencv.py with too many threads as follows: (This code is
only for reference of multi-threading principle, and the OpenCV function is intuitively deleted for the sake of
demonstration)
import os
import cv2
from base_camera import BaseCamera
import numpy as np
import datetime
import time
make it abnormally stuck.
17.2 Multi-thread Processing of Video Frames
Next, the process of multi-thread processing of video frames is introduced: