Remove padding from a previously padded image given original pad widths
im (ND-image) – The padded image from which padding should be removed
pad_width (int or list of ints) – The amount of padding previously added to each axis. This should be the same as the values used to add original padding. Refer to
numpy.paddocumentation for more details.
A use case for this is when using
skimage.morphology.skeletonize_3dto ensure that the skeleton extends beyond the edges of the image, but the padding should be subsequently removed.
Click here to view online example.