Page 1 of 1

Esp32-cam heavily overexposes pictures

Posted: Sat Feb 05, 2022 9:23 am
by Effepi
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

Re: Esp32-cam heavily overexposes pictures

Posted: Thu Feb 10, 2022 10:40 am
by Effepi
Up

Re: Esp32-cam heavily overexposes pictures

Posted: Thu Aug 03, 2023 4:07 pm
by icepick
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.

Re: Esp32-cam heavily overexposes pictures

Posted: Thu Aug 03, 2023 4:21 pm
by icepick
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!

Re: Esp32-cam heavily overexposes pictures

Posted: Fri May 03, 2024 11:48 pm
by slhasana
This worked beautifully for me. Thanks a lot. It turned my pictures from hot garbage to reasonable stuff !!