normalization_wrt_reference_shape

menpofit.builder.normalization_wrt_reference_shape(images, group, diagonal, verbose=False)[source]

Function that normalizes the images’ sizes with respect to the size of the mean shape. This step is essential before building a deformable model.

The normalization includes: 1) Computation of the reference shape as the mean shape of the images’ landmarks. 2) Scaling of the reference shape using the diagonal. 3) Rescaling of all the images so that their shape’s scale is in correspondence with the reference shape’s scale.

Parameters
  • images (list of menpo.image.Image) – The set of images to normalize.

  • group (str) – If str, then it specifies the group of the images’s shapes. If None, then the images must have only one landmark group.

  • diagonal (int or None) – If int, it ensures that the mean shape is scaled so that the diagonal of the bounding box containing it matches the provided value. If None, then the mean shape is not rescaled.

  • verbose (bool, Optional) – Flag that controls information and progress printing.

Returns

  • reference_shape (menpo.shape.PointCloud) – The reference shape that was used to resize all training images to a consistent object size.

  • normalized_images (list of menpo.image.Image) – The images with normalized size.