class documentation
class OpenCVCamera(BaseCamera): (source)
Constructor: OpenCVCamera(thing_server_interface)
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 |
The name of the camera. |
| Method | camera |
Set the name of the camera. |
| Method | capture |
Acquire one image from the camera and return as an array. |
| Method | discard |
Discard frames so that the next frame captured is fresh. |
| Instance Variable | cameras |
Undocumented |
| Instance Variable | cap |
Undocumented |
| Instance Variable | streaming |
Undocumented |
| Property | manual |
The camera settings to expose as property controls in the settings panel. |
| Property | stream |
Whether the MJPEG stream is active. |
| Method | _capture |
Undocumented |
| Method | _capture |
Acquire one image from the camera and return as a PIL image. |
| Method | _start |
Start the camera stream or restart if running. |
| Method | _stop |
Stop the camera stream. |
| Instance Variable | _camera |
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 |
Acquire one image from the camera. |
| 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 an image to memory. This can be saved later with save_from_memory. |
| Method | change |
Change the mode the camera is streaming in. |
| 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 | record |
Record MJPEG stream framerate statistics. |
| 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. |
| Async Method | snapshot |
Return a snapshot from the microscope. |
| 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. |
| Class Variable | supported |
Undocumented |
| Class Variable | supports |
Undocumented |
| Property | background |
The active background detector instance. |
| Property | calibration |
Whether the camera needs calibrating. |
| Property | capture |
Modes the camera can use for capturing. |
| Property | focus |
Return the focus figure of merit. |
| Property | primary |
The calibration actions for both calibration wizard and settings panel. |
| Property | secondary |
The calibration actions that appear only in settings panel. |
| Property | streaming |
Modes the camera can stream in. |
| Property | thing |
Return camera-specific metadata. |
| Method | _add |
Add the EXIF metadata for a JPEG image. |
| Method | _collect |
Return the metadata for a capture. |
| Async Method | _monitor |
Asynchronously monitor the timing on incoming frames. |
| Method | _validate |
Check input capture mode exists, always returns a valid mode. |
| Class Variable | _all |
Undocumented |
| Class Variable | _class |
Undocumented |
| Class Variable | _memory |
Undocumented |
| Instance Variable | _background |
Undocumented |
| Instance Variable | _default |
Undocumented |
| Instance Variable | _framerate |
Undocumented |
Inherited from OFMThing (via BaseCamera):
| Method | create |
Create a RelativeDataPath object with this Thing set as the saving Thing. |
| Property | data |
The data directory for this thing. |
| Property | show |
Whether to show in the Gallery. |
| Class Variable | _show |
Undocumented |
| Instance Variable | _data |
Undocumented |
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.
Iniatilise the thing storing the index of the camera to use.
| Parameters | |
thinglt.ThingServerInterface | The thing server interface to be passed to to the parent class. |
@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.
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.