class documentation

Compare the standard deviations of the LUV channels in a grid to background data.

Using an LUV colour space, each image is divided into an 8x8 grid of images. The standard deviation of each channel of each image is calculated and compared to the median standard deviation for a grid of background images.

Method get_sample_coverage Return the percentage of the input image that is background.
Method image_is_sample Label the current image as either background or sample.
Method set_background Use the input image to update the background distributions.
Class Variable channel_tolerance Channel Tolerance
Class Variable display_name Undocumented
Class Variable min_sample_coverage Sample Coverage Required (%)
Class Variable min_stds Undocumented
Instance Variable background_stds The standard deviation of each channel in the colourspace.
Property ready Whether the background detector is ready.
Property settings_ui A list of PropertyControl objects to create the settings in the UI.

Inherited from BackgroundDetectAlgorithm:

Method __init__ Initialise and create the lock.
def get_sample_coverage(self, image: np.ndarray) -> float: (source)

Return the percentage of the input image that is background.

Evaluate whether it is foreground or background by comparing the standard deviations of an 8x8 grid of sub-images to the median standard deviation from a background image.

Returns
floatA value (between 0 and 100) that is the percentage of the image that is sample.
def image_is_sample(self, image: np.ndarray) -> tuple[bool, str]: (source)

Label the current image as either background or sample.

Returns
tuple[bool, str]A tuple of the result (boolean), and explanation string. The explanation string is formatted so it can be added into a sentence such as An action was taken because the image is {message}.
def set_background(self, image: np.ndarray): (source)

Use the input image to update the background distributions.

channel_tolerance: float = (source)

Channel Tolerance

The number of standard deviations a pixel value must be from the background mean to be considered sample.

min_sample_coverage: float = (source)

Sample Coverage Required (%)

The minimum percentage of the image that needs to be identified as sample for the image to be labeled as containing sample.

min_stds: list[float] = (source)

Undocumented

background_stds: list[float] | None = (source)

The standard deviation of each channel in the colourspace.

@lt.property
ready: bool = (source)
@lt.property
settings_ui: list[PropertyControl] = (source)

A list of PropertyControl objects to create the settings in the UI.