1 2 3 4 5 6 7 8 9 |
<span class="kn">import</span> <span class="nn">time</span> <span class="kn">import</span> <span class="nn">picamera</span> <span class="k">with</span> <span class="n">picamera</span><span class="o">.</span><span class="n">PiCamera</span><span class="p">()</span> <span class="k">as</span> <span class="n">camera</span><span class="p">:</span> <span class="n">camera</span><span class="o">.</span><span class="n">resolution</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1024</span><span class="p">,</span> <span class="mi">768</span><span class="p">)</span> <span class="n">camera</span><span class="o">.</span><span class="n">start_preview</span><span class="p">()</span> <span class="c"># Camera warm-up time</span> <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="n">camera</span><span class="o">.</span><span class="n">capture</span><span class="p">(</span><span class="s">'foo.jpg'</span><span class="p">)</span> |





