package documentation

OpenFlexure Microscope Camera.

This module defines the interface for cameras. Any compatible lt.Thing should enable the server to work.

See repository root for licensing information.

Module opencv OpenFlexure Microscope OpenCV Camera.
Module picamera Submodule for interacting with a Raspberry Pi camera using the Picamera2 library.
Module picamera_recalibrate_utils Functions to set up a Raspberry Pi Camera v2 for scientific use.
Module simulation OpenFlexure Microscope OpenCV Camera.

From __init__.py:

Class ArrayModel A model for an array.
Class BaseCamera The base class for all cameras. All cameras must directly inherit from this class.
Class CameraMemoryBuffer A class that holds images in memory. The images are by default PIL images.
Class JPEGBlob A class representing a JPEG image as a LabThings FastAPI Blob.
Class PNGBlob A class representing a PNG image as a LabThings FastAPI Blob.
Exception CaptureError An error trying to capture from a CameraThing.
Exception NoImageInMemoryError An error called if no image is in memory when accessed.
Function downsample Downsample an image by taking the mean of each nxn region.
Constant LOGGER Undocumented
Variable CameraDependency Undocumented
Variable RawCameraDependency Undocumented
def downsample(factor: int, image: np.ndarray) -> np.ndarray: (source)

Downsample an image by taking the mean of each nxn region.

This should be very efficient:

  • calculate each pixel as the mean of each factor * factor square without
    interpolation.
  • If the image is not an integer multiple of the resampling factor, discard
    the left-over pixels to avoid odd edge effects and keep performance quick.

Undocumented

Value
logging.getLogger(__name__)
CameraDependency = (source)

Undocumented

RawCameraDependency = (source)

Undocumented