class documentation

A Thing that provides and interface to an OpenCV Camera.

Method __enter__ Start the capture thread when the Thing context manager is opened.
Method __exit__ Release the camera when the Thing context manager is closed.
Method __init__ Iniatilise the thing storing the index of the camera to use.
Method camera_name The name of the camera.
Method camera_name.setter Set the name of the camera.
Method capture_array Acquire one image from the camera and return as an array.
Method capture_image Acquire one image from the camera and return as a PIL image.
Method discard_frames Discard frames so that the next frame captured is fresh.
Instance Variable cameras Undocumented
Instance Variable cap Undocumented
Property manual_camera_settings The camera settings to expose as property controls in the settings panel.
Property stream_active Whether the MJPEG stream is active.
Method _capture_frames Undocumented
Method _start_stream Start the camera stream or restart if running.
Method _stop_stream Stop the camera stream.
Instance Variable _camera_name Undocumented
Instance Variable _capture_enabled Undocumented
Instance Variable _capture_thread Undocumented

Inherited from BaseCamera:

Method background_detector_name The name of the active background selector.
Method background_detector_name.setter Validate and set background_detector_name.
Method capture_and_save Capture an image and save it to disk.
Method capture_downsampled_array Acquire one image from the camera, downsample, and return as an array.
Method capture_jpeg Acquire one image from the camera as a JPEG.
Method capture_to_memory Capture an image to memory. This can be saved later with save_from_memory.
Method clear_buffers Clear all images in memory.
Method grab_as_array Acquire one image from the preview stream and return as an array.
Method grab_jpeg Acquire one image from the preview stream and return as blob of JPEG data.
Method grab_jpeg_size Acquire one image from the preview stream and return its size.
Method image_is_sample Label the current image as either background or sample.
Method kill_mjpeg_streams Kill the streams now as the server is shutting down.
Method save_from_memory Save an image that has been captured to memory.
Method set_background Grab an image, and use its statistics to set the background.
Method settle Sleep for the settling time, ready to provide a fresh frame.
Method start_streaming Start (or stop and restart) the camera.
Class Variable downsampled_array_factor The downsampling factor when calling capture_downsampled_array.
Class Variable lores_mjpeg_stream Undocumented
Class Variable mjpeg_stream Undocumented
Class Variable settling_time The settling time when calling the settle() method.
Property background_detector The active background detector instance.
Property calibration_required Whether the camera needs calibrating.
Property primary_calibration_actions The calibration actions for both calibration wizard and settings panel.
Property secondary_calibration_actions The calibration actions that appear only in settings panel.
Property thing_state Return camera-specific metadata.
Method _add_metadata_to_capture Add the EXIF metadata for a JPEG image.
Method _capture_metadata Return the metadata for a capture, from the thing states, time and known names.
Method _robust_image_capture Capture an image in memory and return it with metadata.
Method _save_capture Save the captured image and metadata to disk.
Class Variable _all_background_detectors Undocumented
Class Variable _memory_buffer Undocumented
Instance Variable _background_detector_name Undocumented
Instance Variable _default_background_detector Undocumented
def __enter__(self) -> Self: (source)

Start the capture thread when the Thing context manager is opened.

def __exit__(self, exc_type: type[BaseException], exc_value: BaseException | None, traceback: TracebackType | None): (source)

Release the camera when the Thing context manager is closed.

Before releasing the camera the capture thread is closed.

def __init__(self, thing_server_interface: lt.ThingServerInterface): (source)

Iniatilise the thing storing the index of the camera to use.

Parameters
thing_server_interface:lt.ThingServerInterfaceThe thing server interface to be passed to to the parent class.
@lt.setting
def camera_name(self) -> str: (source)

The name of the camera.

def camera_name(self, value: str): (source)

Set the name of the camera.

@lt.action
def capture_array(self, stream_name: Literal['main', 'lores', 'raw', 'full'] = 'full', wait: float | None = None) -> NDArray: (source)

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.

def capture_image(self, stream_name: Literal['main', 'lores', 'full'] = 'main', wait: float | None = None) -> Image.Image: (source)

Acquire one image from the camera and return as a PIL image.

This function will produce a JPEG image.

@lt.action
def discard_frames(self): (source)

Discard frames so that the next frame captured is fresh.

cameras: dict[str, int] = (source)

Undocumented

Undocumented

@lt.property
manual_camera_settings: list[PropertyControl] = (source)

The camera settings to expose as property controls in the settings panel.

The options for the camera selector are populated with camera names once the server starts and available cameras are have been detected.

@lt.property
stream_active: bool = (source)

Whether the MJPEG stream is active.

def _capture_frames(self): (source)

Undocumented

def _start_stream(self): (source)

Start the camera stream or restart if running.

def _stop_stream(self): (source)

Stop the camera stream.

_camera_name = (source)

Undocumented

_capture_enabled: bool = (source)

Undocumented

_capture_thread: Thread | None = (source)

Undocumented