wormpose.dataset.image_processing.frame_preprocessor

Applies safely the frame preprocessing function to a frame, set the background pixels to a uniform value, deduces the region of interest

wormpose.dataset.image_processing.frame_preprocessor.run(frame_preprocessing: wormpose.dataset.base_dataset.BaseFramePreprocessing, frame: numpy.ndarray) Tuple[numpy.ndarray, int, Tuple[slice, slice]][source]

Safely preprocesses an image, set the background pixels to a uniform color, calculates worm region of interest

Parameters
  • frame_preprocessing – Frame preprocessing logic

  • frame – Image to preprocess

Returns

Processed image, value of the background color, region of interest coordinates