wormpose.images.real_dataset

Builds the real dataset, where images from a dataset are preprocessed and then cropped to be the same size

class wormpose.images.real_dataset.RealDataset(frame_preprocessing: wormpose.dataset.base_dataset.BaseFramePreprocessing, output_image_shape: Tuple[int, int])[source]

The RealDataset takes a raw image and apply the FramePreprocessing, it also ensures all the resulting images have the same size, by expanding the region if necessary, or by simply cropping

Parameters
  • frame_preprocessing – the FramePreprocessing object containing the image preprocessing logic

  • output_image_shape – the desired output size of the images

process_frame(cur_frame: numpy.ndarray)[source]

Processes one image

Parameters

cur_frame – Raw frame from a dataset to process

Returns

Processed version of the frame and normalized to the desired image size