Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/labthings_picamera2/thing.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,21 @@ def snap_image(self) -> ArrayModel:

@thing_action
def capture_array(
self, stream_name: Literal["main", "lores", "raw"] = "main"
self,
stream_name: Literal["main", "lores", "raw"] = "main",
wait: Optional[float] = None,
) -> ArrayModel:
"""Acquire one image from the camera and return as an array

This function will produce a nested list containing an uncompressed RGB image.
It's likely to be highly inefficient - raw and/or uncompressed captures using
binary image formats will be added in due course.

stream_name: (Optional) The PiCamera2 stream to use, should be one of ["main", "lores", "raw"]. Default = "main"
wait: (Optional, float) Set a timeout in seconds. A TimeoutError is raised if this time is exceeded during capture. Default = None
"""
with self.picamera() as cam:
return cam.capture_array(stream_name)
return cam.capture_array(stream_name, wait = wait)

@thing_action
def capture_raw(
Expand Down