Esp32-cam heavily overexposes pictures

Effepi
Posts: 2
Joined: Sat Feb 05, 2022 9:04 am

Esp32-cam heavily overexposes pictures

Postby Effepi » Sat Feb 05, 2022 9:23 am

Hi all,
I'm pointing my esp32-cam towards my garden and taking pictures every X minutes. Maybe half of the frame is sky, and the images come out soo overexposed that they are basically just white.

I'm using a simple piece of code like this:
https://pastebin.com/ihDePDSn

I've read to try to put a delay() before shooting (as in the code), to allow the camera to adjust the autoexposure.. but it doesn't work.

I tried to alternate delay() and esp_camera_fb_get() , e.g: for (1..N){delay;shoot},
with the idea to allow the ESP to adjust the exposure after few shots, but the ESP seem to crash if I use more than 2 shoots one after the other.

I also tried to manually unset the gain (set_gain_ctrl()) but nope..

I am a little bit at loss here.. can anyone suggest a good strategy?

Thanks!
FP

Effepi
Posts: 2
Joined: Sat Feb 05, 2022 9:04 am

Re: Esp32-cam heavily overexposes pictures

Postby Effepi » Thu Feb 10, 2022 10:40 am

Up

icepick
Posts: 3
Joined: Thu May 18, 2023 1:58 pm

Re: Esp32-cam heavily overexposes pictures

Postby icepick » Thu Aug 03, 2023 4:07 pm

Any solution to this problem? I am having the same problem.. outdoor images are unusuable.. the weird thing is that the CameraWebServer sample doesn't have this problem.

icepick
Posts: 3
Joined: Thu May 18, 2023 1:58 pm

Re: Esp32-cam heavily overexposes pictures

Postby icepick » Thu Aug 03, 2023 4:21 pm

This seems to solve it mostly... taking 10 pictures quickly and clear the buffer all the time;

Code: Select all

 // Take a photo with the camera
  Serial.println("Taking a photo…");
  //The first three pictures after restart have a green tint, discard  those images
  for (int i = 0; i <=10; i++){
    Serial.println("Taking a photo…");
    camera_fb_t * fb = NULL;
    fb = esp_camera_fb_get();
    esp_camera_fb_return(fb); // dispose the buffered image
   }
  fb = NULL; // reset to capture errors
  // Get fresh image
  fb = esp_camera_fb_get();

  if(!fb) {
    Serial.println("Camera capture failed");
    delay(1000);
    ESP.restart();
  }
Hope it helps someone!

slhasana
Posts: 1
Joined: Fri May 03, 2024 11:47 pm

Re: Esp32-cam heavily overexposes pictures

Postby slhasana » Fri May 03, 2024 11:48 pm

This worked beautifully for me. Thanks a lot. It turned my pictures from hot garbage to reasonable stuff !!

Who is online

Users browsing this forum: Bing [Bot] and 116 guests