extract_local_patches

menpo.fitmultilevel.functions.extract_local_patches(image, centres, sampling_grid)[source]

Extract square patches from an image about centres.

Parameters:

image : Image

The image to extract patches from

centres : PointCloud

The centres around which the patches should be extracted

sampling_grid : ndarray of shape: ``(patch_shape[0]+1, patch_shape[1]+1,

n_dims)`` :

The size of the patch in each dimension

Returns:

patches : ndarray` of shape: n_centres, + patch_shape + n_channels,

The patches as a single numpy array.