skimage 0.17.2

NotesParametersReturnsBackRef
_fast_pad(image, value, *, order='C')

Notes

The output of this function is equivalent to:

np.pad(image, 1, mode="constant", constant_values=value)

Up to versions < 1.17 numpy.pad uses concatenation to create padded arrays while this method needs to only allocate and copy once. This can result in significant speed gains if :None:None:`image` has a large number of dimensions. Thus this function may be safely removed once that version is the minimum required by scikit-image.

Parameters

image : ndarray

Image to pad.

value : scalar

The value to use. Should be compatible with :None:None:`image`'s dtype.

order : "C" or "F"

Specify the memory layout of the padded image (C or Fortran style).

Returns

padded_image : ndarray

The new image.

Pad an array on all axes by one with a value.

Examples

This example is valid syntax, but we were not able to check execution
>>> _fast_pad(np.zeros((2, 3), dtype=int), 4)
array([[4, 4, 4, 4, 4],
       [4, 0, 0, 0, 4],
       [4, 0, 0, 0, 4],
       [4, 4, 4, 4, 4]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.morphology._util._fast_pad

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/morphology/_util.py#213
type: <class 'function'>
Commit: