Tutorial

Table Of Contents
92
img = camera.read()
if cvt.CVThreading:
'''
If OpenCV is processing video frames, skip
'''
pass
else:
'''
If OpenCV is not processing video frames, give the video frame processing thread a new video frame
and resume the processing thread
'''
cvt.mode(img)
cvt.resume()
'''
Draw elements on the screen
'''
img = cvt.elementDraw(img)
# encode as a jpeg image and return it
yield cv2.imencode('.jpg', img)[1].tobytes()
The above is the code principle of using multi-threading to process OpenCV. The following introduction
of specific functions of OpenCV will skip the explanation of multi-threading and directly introduce OpenCV's
method of processing video frames.