skimage2.morphology.pad_footprint#

skimage2.morphology.pad_footprint(footprint, *, pad_end=True)[source]#

Pad the (decomposed) footprint to an odd size along each dimension.

Parameters:
footprintndarray or tuple

The input footprint or sequence of footprints

pad_endbool, optional

If True, pads at the end of each dimension (right side), otherwise pads on the front (left side).

Returns:
paddedndarray or tuple

The footprint, padded to an odd size along each dimension.

See also

mirror_footprint

Mirror each dimension in the (decomposed) footprint.

Examples

>>> footprint = np.array([[0, 0],
...                       [1, 1],
...                       [1, 1]], np.uint8)
>>> pad_footprint(footprint)
array([[0, 0, 0],
       [1, 1, 0],
       [1, 1, 0]], dtype=uint8)