I get that we need to let the camera warming up to set AWB and other automatic stuffs, but, how and when ?

I see people using time.sleep(1) or time.sleep(2), and regarding to discussions, this seems to be arbitrary large value to be safe.

The question of "when" is more important. I have several pictures to take, and before each capture I need to manually set up the shutter speed. Should I sleep to let the camera warm up :

  • Only once at the begining of the program?
  • Before every shutter speed setting?
  • Between every shutter speed setting and capture?

The code

from picamera import PiCamera
from time import sleep
with Picamera() as cam :
  # sleep here? #
  cam.iso = 800
  # sleep here? #
  for i in something_something :
    # sleep here ? #
    shutter_speed_wanted = some_function (i)
    cam.framerate = min (30, (10**6) / shutter_speed_wanted)
    cam.shutter_speed = shutter_speed_wanted
    # sleep here? #
    cam.capture ("file_number_{}.jpg".format (i))

For the record, I am using a pi camera module V2 NoIR, and set shutter_speeds to values that range from 10µs to 1s (such big shutter speeds are why I also set the framerate of the camera).

  • 1
    Why even bother with warmup? Cant you just grap frames (images) from a stream that just runs continuously? – Piotr Kula Feb 25 at 10:43
  • I prefer to take pictures rather than picking from a stream because we are very thrifty about energy. I am not sure that my strategy is the best though. But wouldn't the problem be still present with a stream ? I would need to change shutter_speed during the stream, so I would need to wait for changes to apply / AWB to be recalculated, wouldn't I ? – Motiss Feb 25 at 11:11
  • OK well you never mentioned that power consumption is an issue in your question, and that is why you doing it that way. Have you actually tested running a stream, vs 100 warm ups in the same time and checking which draws more power. I would not be surprised if the warm ups draw more power. Capturing the frames using framebuffer or an app like motion, pymotion or opencv. Or look in their source how they capture and interlace to a picture. – Piotr Kula Feb 25 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.