extract_patches

menpofit.builder.extract_patches(images, shapes, patch_shape, normalise_function=<function no_op>, prefix='', verbose=False)[source]

Function that extracts patches around the landmarks of the provided images.

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

  • shapes (list of menpo.shape.PointCloud) – The set of shapes that correspond to the images.

  • patch_shape ((int, int)) – The shape of the patches.

  • normalise_function (callable) – A normalisation function to apply on the values of the patches.

  • prefix (str) – The prefix of the printed information.

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

Returns

patch_images (list of menpo.image.Image) – The list of images with the patches per image. Each output image has shape (n_center, n_offset, n_channels, patch_shape).