7월, 2020의 게시물 표시

Video Processing Speed up

이미지
The structure of reading video files and processing frames in OpenCV is as follows. cap = cv2 . VideoCapture( videofile) while True : ret, frame = cap . read() if ret == False : break ''' Do what you want to do ''' cv2 . destroyAllWindows() cap . release() In the while loop, the cap.read() function is responsible for reading frames from the video file. This function is fast on devices with good CPU performance, but SBC like Raspberry Pi has a lot less CPU performance than PC. The time it takes to process the cap.read() function depends on the video file. If the video file frame size is large, or if a video codec that requires a lot of time in the decoding process is used, the frame reading time will be longer. In the code above, the while loop consists of two parts. Read video frame Process of processing the read frame according to the purpose However, since these operations are performed sequentially, processing c...