module documentation

Provide functionality to detect if the camera is imaging sample or background.

An example background image is captured by the camera and sent to classes in the module for analysis. Information from these images is used to detect whether an image from the current camera field of view contains sample.

Class BackgroundDetectAlgorithm The base class for defining background detect algorithms.
Class ChannelDeviationLUV Compare the standard deviations of the LUV channels in a grid to background data.
Class ColourChannelDetectLUV Compare images with a known background in LUV colourspace.
Exception ChannelBlankError An error raised if a channel has no measured standard deviation.
Exception MissingBackgroundDataError An error raised if checking for sample without background data set.
Type Variable BackgroundType Undocumented
Type Variable SettingsType Undocumented
Function _chunked_stds Split image into a grid and calculate std of each channel in each chunk.
BackgroundType = (source)

Undocumented

Value
TypeVar('BackgroundType',
        bound=BaseModel)
SettingsType = (source)

Undocumented

Value
TypeVar('SettingsType',
        bound=BaseModel)
def _chunked_stds(img: np.ndarray, n_rows: int = 8, n_cols: int = 8) -> np.ndarray: (source)

Split image into a grid and calculate std of each channel in each chunk.

Parameters
img:np.ndarrayThe image to analyse
n_rows:intThe number of rows in the grid
n_cols:intThe number of cols in the grid
Returns
np.ndarrayA numpy array of the grid of standard deviations.