简体   繁体   English

PiCamera 食谱中的“睡眠”是什么?

[英]For what "sleep" in recipes PiCamera?

In most part recipes for PiCamera it is time.sleep() before camera.capture ( official tutorial ).在 PiCamera 的大部分食谱中,它是 time.sleep time.sleep() before camera.capture官方教程)。 Here it is only comment: "# Camera warm-up time" .这里只有注释: “# 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?循环使用camera.capture需要热身吗? 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.这只是为了允许来自相机的前几帧进行过滤,因为在建立 stream 时质量通常很差。 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 .此处的 Raspberry Pi 论坛上提出了类似的问题。 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).所以是的,你需要它来拍摄一张图片,但不,你不应该需要它一个周期(除非你在每个周期都丢失并重新启动 stream)。 2 seconds should work for your purposes; 2 秒应该适合您的目的; if results are poor you can increase as necessary.如果效果不佳,您可以根据需要增加。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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