简体   繁体   中英

For what "sleep" in recipes PiCamera?

In most part recipes for PiCamera it is time.sleep() before camera.capture ( official tutorial ). Here it is only comment: "# Camera warm-up time" .

  1. But how exactly it warms? For what?
  2. Do I need make warm-up if I use camera.capture in a cycle? Or it is enough only one time, in first iteration?
  3. How I should choose a count of seconds to warm-up?

This is just to allow the first few frames from the camera to filter through since there is often poor quality as the stream is established. The camera also has to start up and often has poor framerate for the first second or two. Similar question asked on Raspberry Pi forums here . So yes, you need it for a single picture but no, you shouldn't need it for a cycle (unless you're losing and restarting the stream in every cycle). 2 seconds should work for your purposes; if results are poor you can increase as necessary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM