class OpenCVCamera(BaseCamera): (source)
Constructor: OpenCVCamera(thing_server_interface, camera_index)
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 PIL image. |
| 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 name of the active background selector. |
| Method | background |
Validate and set background_detector_name. |
| 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 |
Acquire one image from the camera as a JPEG. |
| Method | capture |
Capture an image to memory. This can be saved later with save_from_memory. |
| Method | clear |
Clear all images in memory. |
| 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. |
| 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. |
| Property | background |
The active background detector instance. |
| Property | calibration |
Whether the camera needs calibrating. |
| 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. |
| Property | thing |
Empty metadata dict for subclasses to populate. |
| Method | _add |
Add the EXIF metadata for a JPEG image. |
| Method | _capture |
Return the metadata for a capture, from the thing states, time and known names. |
| Method | _robust |
Capture an image in memory and return it with metadata. |
| Method | _save |
Save the captured image and metadata to disk. |
| Class Variable | _all |
Undocumented |
| Class Variable | _memory |
Undocumented |
| Instance Variable | _background |
Undocumented |
| Instance Variable | _default |
Undocumented |
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.
lt.ThingServerInterface, camera_index: int = 0):
(source)
¶
Iniatilise the thing storing the index of the camera to use.
| Parameters | |
thinglt.ThingServerInterface | Undocumented |
cameraint | The index of the camera to use for the microscope. |
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.
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.