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 | 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 | cameras |
Undocumented |
| Instance Variable | cap |
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 | _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 |
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 | primary |
The calibration actions for both calibration wizard and settings panel. |
| Property | secondary |
The calibration actions that appear only in settings panel. |
| Property | thing |
Return camera-specific metadata. |
| 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.
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. |
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.
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.