class ColourChannelDetectLUV(BackgroundDetectAlgorithm): (source)
Constructor: ColourChannelDetectLUV(thing_server_interface)
Compare images with a known background in LUV colourspace.
This uses an LUV colour space checking only the mean and standard deviation of the U and V channels. The LUV colourspace as it collect colours together in a human- intuitive way.
| Method | background |
Calculate a binary image, showing whether each pixel is background. |
| Method | get |
Return the percentage of the input image that is background. |
| Method | image |
Label the current image as either background or sample. |
| Method | set |
Use the input image to update the background distributions. |
| Class Variable | channel |
Channel Tolerance |
| Class Variable | display |
Undocumented |
| Class Variable | min |
Sample Coverage Required (%) |
| Class Variable | min |
Undocumented |
| Instance Variable | background |
The mean of each channel in the colourspace. |
| Instance Variable | background |
The standard deviation of each channel in the colourspace. |
| Property | ready |
Whether the background detector is ready. |
| Property | settings |
A list of PropertyControl objects to create the settings in the UI. |
Inherited from BackgroundDetectAlgorithm:
| Method | __init__ |
Initialise and create the lock. |
Calculate a binary image, showing whether each pixel is background.
True is background.
The image should be in LUV format, the output will be binary with the same shape in the first two dimensions.
Return the percentage of the input image that is background.
Evaluate whether it is foreground or background by comparing it to the saved statistics for a background image on a per-pixel basis
| Returns | |
float | A value (between 0 and 100) is the percentage of the image that is sample. |
openflexure_microscope_server.things.background_detect.BackgroundDetectAlgorithm.image_is_sampleLabel the current image as either background or sample.
| Returns | |
tuple[ | 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}. |
openflexure_microscope_server.things.background_detect.BackgroundDetectAlgorithm.set_backgroundUse the input image to update the background distributions.
Channel Tolerance
The number of standard deviations a pixel value must be from the background mean to be considered sample.
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.
openflexure_microscope_server.things.background_detect.BackgroundDetectAlgorithm.settings_uiA list of PropertyControl objects to create the settings in the UI.