User Manual
Table Of Contents
- 1. Premise
- 2. Raspberry Pi System Installation and Developmen
- 3 Log In to The Raspberry Pi and Install The App
- 4 Raspberry Pi Structure Assembly and Precautions
- 5 Controlling A 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 Calling the API to Control the Robot
- 12 Automatic Stabilization Function
- 13 Gait Generation Method of A Hexapod Robot
- 14 Make A Police Light or Breathing Light
- 15 Real-Time Video Transmission
- 16 Why OpenCV Uses Multi-threading to Process Vide
- 17 OpenCV Learn to Use OpenCV
- 18 Using OpenCV to Realize Color Recognition and T
- 19 Machine Line Tracking Based on OpenCV
- 20 Create A WiFi Hotspot on The Raspberry Pi
- 21 Install GUI Dependent Item under Window
- 22 How to Use GUI
- 23 Enable UART
- 24 Control Your Adeept_RaspClaws with An Android D
- Conclusion
100
import threading
import imutils
class CVThread(threading.Thread):
'''
This class is used to process OpenCV analysis of video frames in the background. For more basic usage principles of
the multi-threaded class, please refer to 14.2
'''
def __init__(self, *args, **kwargs):
self.CVThreading = 0
super(CVThread, self).__init__(*args, **kwargs)
self.__flag = threading.Event()
self.__flag.clear()
def mode(self, imgInput):
'''
This method is used for incoming video frames that need to be processed
'''
self.imgCV = imgInput
self.resume()
def elementDraw(self,imgInput):
'''
Draw elements in the picture
'''
return imgInput
def doOpenCV(self, frame_image):
'''
Add the content to be processed by OpenCV here
'''
self.pause()
def pause(self):
'''
Block the thread and wait for the next frame
'''
self.__flag.clear()