AFL.automation.vision.PiCameraDriver#
A server-facing driver for Raspberry Pi cameras using Picamera2.
Classes
|
|
|
Provide circular ROI, RGB, background, and turbidity processing. |
|
PurePath subclass that can make system calls. |
|
Capture still images from a Raspberry Pi camera. |
|
The year, month and day arguments are required. |
|
Fixed offset from UTC implementation of tzinfo. |
- class AFL.automation.vision.PiCameraDriver.PiCameraDriver(camera=None, overrides=None, name='PiCameraDriver', initialize_driver=True)[source]#
Capture still images from a Raspberry Pi camera.
picamera2is loaded only when a real camera is constructed, so this module can be imported on development machines and in test environments without Raspberry Pi camera support. A camera-like object may be supplied to the constructor for testing; it must providecapture_arrayand/orcapture_file.- defaults = {'image_format': 'jpg', 'output_dir': 'camera_images', 'resolution': [1920, 1080], 'stream_address': '127.0.0.1:8000', 'stream_bitrate': 10000000, 'warmup_seconds': 1.0}#
- __init__(camera=None, overrides=None, name='PiCameraDriver', initialize_driver=True)[source]#
Create the driver and initialize a real Picamera2 when needed.
- capture(save=False, filename=None)[source]#
Take one image, optionally saving it to the configured output directory.
When
saveis false, the captured image is placed in the driver’s dropbox and the returnedimage_uidcan be retrieved through the API server. Whensaveis true, Picamera2 writes the image directly and the returnedpathidentifies the saved file.
- start_streaming(address=None)[source]#
Start an H.264 TCP stream listener at
address.When omitted,
addressuses the configuredstream_address(127.0.0.1:8000by default). It must behost:port(for example0.0.0.0:8000). The driver listens immediately, and begins streaming only after one client connects. It does not start automatically during driver setup.