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 | capture |
Acquire one image from the camera and return as an array. |
| Method | capture |
Acquire one image from the camera and return as a JPEG blob. |
| Method | discard |
Discard frames so that the next frame captured is fresh. |
| Instance Variable | camera |
Undocumented |
| Instance Variable | cap |
Undocumented |
| Property | stream |
Whether the MJPEG stream is active. |
| Method | _capture |
Undocumented |
| Instance Variable | _capture |
Undocumented |
| Instance Variable | _capture |
Undocumented |
Inherited from BaseCamera:
| Method | background |
The data for each background detector, used to save to disk. |
| Method | background |
Set the data for each detector. Only to be used as settings are loaded from disk. |
| Method | capture |
Capture an image and save it to disk. |
| Method | capture |
Acquire one image from the camera, downsample, and return as an array. |
| Method | capture |
Capture a PIL image from stream stream_name with timeout wait. |
| Method | capture |
Capture an image to memory. This can be saved later with save_from_memory. |
| Method | clear |
Clear all images in memory. |
| Method | detector |
The name of the active background selector. |
| Method | detector |
Validate and set detector_name. |
| Method | grab |
Acquire one image from the preview stream and return as an array. |
| Method | grab |
Acquire one image from the preview stream and return as blob of JPEG data. |
| Method | grab |
Acquire one image from the preview stream and return its size. |
| Method | image |
Label the current image as either background or sample. |
| Method | kill |
Kill the streams now as the server is shutting down. |
| Method | save |
Save an image that has been captured to memory. |
| Method | set |
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 |
Start (or stop and restart) the camera. |
| Method | update |
Update the settings of the current detector. |
| Class Variable | downsampled |
The downsampling factor when calling capture_downsampled_array. |
| Class Variable | lores |
Undocumented |
| Class Variable | mjpeg |
Undocumented |
| Class Variable | settling |
The settling time when calling the settle() method. |
| Instance Variable | background |
Undocumented |
| Property | active |
The active background detector instance. |
| Property | background |
The status of the active detector for the UI. |
| Property | manual |
The camera settings to expose as property controls in the settings panel. |
| Property | primary |
The calibration actions for both calibration wizard and settings panel. |
| Property | secondary |
The calibration actions that appear only in settings panel. |
| Method | _robust |
Capture an image in memory and return it with metadata. |
| Method | _save |
Save the captured image and metadata to disk. |
| Class Variable | _memory |
Undocumented |
| Instance Variable | _detector |
Undocumented |
Release the camera when the Thing context manager is closed.
Before releasing the camera the capture thread is closed.
Iniatilise the thing storing the index of the camera to use.
| Parameters | |
cameraint | The index of the camera to use for the microscope. |
@lt.thing_action
def capture_array(self, resolution: Literal[ 'main', 'full'] = 'full') -> 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.
@lt.thing_action
def capture_jpeg(self, metadata_getter: lt.deps.GetThingStates, resolution: Literal[ 'main', 'full'] = 'main') -> JPEGBlob:
(source)
¶
Acquire one image from the camera and return as a JPEG blob.
This function will produce a JPEG image.