wormpose.images.scoring.centerline_accuracy_check

Assesses the accuracy of a centerline theta compared to a real image, by calculating the image similarity metric

class wormpose.images.scoring.centerline_accuracy_check.CenterlineAccuracyCheck(frame_preprocessing: wormpose.dataset.base_dataset.BaseFramePreprocessing, image_shape)[source]

Class that performs comparison (image similarity) to assess how a centerline accurately represents a real image.

It first preprocesses the original real image with a BaseFramePreprocessing class (crop and set the background pixels to a uniform color). Then, it creates a synthetic image representing the centerline theta, using a provided template image. Typically, the template image was chosen to be the closest labelled image in time to the real image. The synthetic image is cropped to fit the worm, in order to apply a template matching function between the real image (full size) and the synthetic image (smaller) The result is an image similarity value and the synthetic image skeleton coordinates.