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_as_array Acquire one image from the camera and return as an array.
Method discard_frames Discard frames so that the next frame captured is fresh.
Instance Variable cameras Undocumented
Instance Variable cap Undocumented
Instance Variable streaming_mode 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 _capture_image Acquire one image from the camera and return as a PIL image.
Method _start_streaming Start the camera stream or restart if running.
Method _stop_streaming 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 Acquire one image from the camera.
Method capture_and_save_to_path 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_to_memory Capture an image to memory. This can be saved later with save_from_memory.
Method change_streaming_mode Change the mode the camera is streaming in.
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 record_framerate Record MJPEG stream framerate statistics.
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.
Async Method snapshot Return a snapshot from the microscope.
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.
Class Variable supported_image_formats Undocumented
Class Variable supports_focus_fom Undocumented
Property background_detector The active background detector instance.
Property calibration_required Whether the camera needs calibrating.
Property capture_modes Modes the camera can use for capturing.
Property focus_fom Return the focus figure of merit.
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 streaming_modes Modes the camera can stream in.
Property thing_state Return camera-specific metadata.
Method _add_metadata_to_capture Add the EXIF metadata for a JPEG image.
Method _collect_ofm_metadata Return the metadata for a capture.
Async Method _monitor_framerate Asynchronously monitor the timing on incoming frames.
Method _validate_capture_mode Check input capture mode exists, always returns a valid mode.
Class Variable _all_background_detectors Undocumented
Class Variable _class_settings Undocumented
Class Variable _memory_buffer Undocumented
Instance Variable _background_detector_name Undocumented
Instance Variable _default_background_detector Undocumented
Instance Variable _framerate_monitor_running Undocumented

Inherited from OFMThing (via BaseCamera):

Method create_data_path Create a RelativeDataPath object with this Thing set as the saving Thing.
Property data_dir The data directory for this thing.
Property show_data_in_gallery Whether to show in the Gallery.
Class Variable _show_data_in_gallery Undocumented
Instance Variable _data_dir 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_as_array(self, capture_mode: str = 'standard', raw: bool = False) -> NDArray: (source)

Acquire one image from the camera and return as an array.

@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 _capture_image(self, capture_mode: str = 'standard') -> Image.Image: (source)

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

def _start_streaming(self, mode: str = 'default'): (source)

Start the camera stream or restart if running.

def _stop_streaming(self): (source)

Stop the camera stream.

_camera_name = (source)

Undocumented

_capture_enabled: bool = (source)

Undocumented

_capture_thread: Thread | None = (source)

Undocumented