[Python] Writing images to hard disk fast using openCV [closed]

Discussão em 'Python' iniciado por Stack, Novembro 27, 2024.

  1. Stack

    Stack Membro Participativo

    I want to use a picamera and a raspberryPi to record image sequences using libcamera2 and openCV at around 2-3 Hz frame rate. The camera delivers 4056 x 3040 x 3 uint8 arrays. Writing the data as images or video to the hard disk is limiting my recording frame rate significantly.

    When I try to append images to a video file using cv2.VideoWriter() converting the single images to the video format adds around a second to each single frame. When I try to dump the single images as bmp files (no compression) using imwrite() to the hard disk my frame rate is not stable, most frames take 0.5 seconds while every 10th frame takes 2-4 seconds. Superficially, it seems that there no background processes that cause these delays.

    What is the best general approach to write individual frames as fast as possible to the harddisk? Is there a compressionless and fast format for the VideoWriter?

    Continue reading...

Compartilhe esta Página