-
-
-
Set up camera
-
attach
-
configure the camera on
-
sudo raspi-config
-
Documentation
$ python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more
information.
>>> import picamera
>>> help (picamera.camera)
...
| capture(self, output, format=None,
use_video_port=False, resize=None, splitter_port=0,
bayer=False, **options)
|
Capture an image from the camera, storing it in *output*.
|
| If
*output* is a string, it will be treated as a filename for a
new
| file
which the image will be written to. If *output* is not a
string,
| but
is an object with a ``write`` method, it is assumed to be a
|
file-like object and the image data is appended to it (the
|
implementation only assumes the object has a ``write`` method
- no
| other
methods are required but ``flush`` will be called at the end
of
|
capture if it is present). If *output* is not a string, and
has no
|
``write`` method it is assumed to be a writeable object
implementing
| the
buffer protocol. In this case, the image data will be written
|
directly to the underlying buffer (which must be large enough
to accept
| the
image data).
|
| If
*format* is ``None`` (the default), the method will attempt to
guess
| the
required image format from the extension of *output* (if it's
a
|
string), or from the *name* attribute of *output* (if it has
one). In
| the
case that the format cannot be determined, a
|
:exc:`PiCameraValueError` will be raised.
|
| If
*format* is not ``None``, it must be a string specifying the
format
| that
you want the image output in. The format can be a MIME-type or
| one
of the following strings:
|
| *
``'jpeg'`` - Write a JPEG file
| *
``'png'`` - Write a PNG file
| *
``'gif'`` - Write a GIF file
| *
``'bmp'`` - Write a Windows bitmap file
| *
``'yuv'`` - Write the raw image data to a file in YUV420
format
| *
``'rgb'`` - Write the raw image data to a file in 24-bit RGB
format
| *
``'rgba'`` - Write the raw image data to a file in 32-bit RGBA
format
| *
``'bgr'`` - Write the raw image data to a file in 24-bit BGR
format
| *
``'bgra'`` - Write the raw image data to a file in 32-bit BGRA
format
| *
``'raw'`` - Deprecated option for raw captures; the format is
taken
| from the
deprecated :attr:`raw_format` attribute
|
| The
*use_video_port* parameter controls whether the camera's image
or
| video
port is used to capture images. It defaults to ``False`` which
...
-
Python still