Tutorial
Table Of Contents
- 1. Premise
- 2. Raspberry Pi System Installation and Developmen
- 3 Log In to The Raspberry Pi and Install The App
- 4 Assembly and Precautions
- 5 Controlling Robot via WEB App
- 6 Common Problems and Solutions(Q&A)
- 7 Set The Program to Start Automatically
- 8 Remote Operation of Raspberry Pi Via MobaXterm
- 9 How to Control WS2812 RGB LED
- 10 How to Control The Servo
- 11 How to Control DC Motor
- 12 Ultrasonic Module
- 13 Line Tracking
- 14 Make A Police Light or Breathing Light
- 15 Real-Time Video Transmission
- 16 Automatic Obstacle Avoidance
- 17 Why OpenCV Uses Multi-threading to Process Vide
- 18 OpenCV Learn to Use OpenCV
- 19 Using OpenCV to Realize Color Recognition and T
- 20 Machine Line Tracking Based on OpenCV
- 21 Create A WiFi Hotspot on The Raspberry Pi
- 22 Install GUI Dependent Item under Window
- 23 How to Use GUI
- 24 Control The WS2812 LED via GUI
- 25 Real-time Video Transmission Based on OpenCV
- 26 Use OpenCV to Process Video Frames on The PC
- 27 Enable UART
- 28 Control Your AWR with An Android Device
- Conclusion
88
17 Why OpenCV Uses Multi-threading to
Process Video Frames
●The OpenCV function is based on the GitHub project flask-video-streaming, we changed the
camera_opencv.py to perform OpenCV related operations.
17.1 Single Thread Processing of Video Frames
● First, we introduce the process of single-thread processing of video frames. Let ’s start with a simple
one, so that you will understand why OpenCV uses multiple threads to process video frames. The process of
single-thread processing of video frames is as follows:
● Process explanation: First obtain a frame from the camera, and then use OpenCV to analyze the
content of this frame. After the analysis is completed, the information to be drawn is generated, such as the
position of the center point of the target object, the text lamp information that needs to be generated on the
screen, then Draw those elements on the screen according to the generated drawing information, and finally
display the processed and drawn frame on the page.
●Such a processing flow will cause each frame to be collected to wait for the OpenCV related process to
be processed. After this frame is displayed, the second frame can be collected for processing and analysis to