How to capture two images in a row with the ESP32 camera driver?

Kampino
Posts: 7
Joined: Fri Jan 08, 2021 12:19 pm

How to capture two images in a row with the ESP32 camera driver?

Postby Kampino » Fri Aug 27, 2021 7:53 am

Hello,

I try to capture two images with different light scenarios by using the ESP32 camera driver. My code looks like the following example:

Code: Select all

camera_config_t CameraConfig;
...
CameraConfig.fb_count = 2;
esp_camera_init(&CameraConfig);

Image1 = esp_camera_fb_get();
...
Image2 = esp_camera_fb_get();
...
<Transmit image 2>
...
esp_camera_fb_return(Image1);
esp_camera_fb_return(Image2);
But it turns out that the content of the transmitted image 2 is the content of image 1 (or vice versa when I flip the image order). The content of the transmitted image is correct, when I change the parameter fb_count to 1, because the second image will overwrite the data of the first image. But it looks like the solution with two framebuffers doesn´t work and both frame buffers contain a different amount of pixels, but the data seems to be the same.

Does anybody know this issue? I have implemented a workaround with a single frame buffer for the driver and a copy process of each image, but I don´t really like this solution.

Who is online

Users browsing this forum: No registered users and 96 guests