{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / morphology / footprints / ellipse

function

skimage.morphology.footprints:ellipse

source: /dev/scikit-image/src/skimage/morphology/footprints.py :631

Signature

def   ellipse ( width height dtype = <class 'numpy.uint8'> * decomposition = None )

Summary

Generates a flat, ellipse-shaped footprint.

Extended Summary

Every pixel along the perimeter of ellipse satisfies the equation (x/width+1)**2 + (y/height+1)**2 = 1.

Parameters

width : int

The width of the ellipse-shaped footprint.

height : int

The height of the ellipse-shaped footprint.

Returns

footprint : ndarray

The footprint where elements of the neighborhood are 1 and 0 otherwise. The footprint will have shape (2 * height + 1, 2 * width + 1).

Other Parameters

dtype : dtype-like, optional

The data type of the footprint.

decomposition : {None, 'crosses'}, optional

If None, a single array is returned. For 'sequence', a tuple of smaller footprints is returned. Applying this series of smaller footprints will given an identical result to a single, larger footprint, but with better computational performance. See Notes for more details.

Notes

When decomposition is not None, each element of the footprint tuple is a 2-tuple of the form (ndarray, num_iter) that specifies a footprint array and the number of iterations it is to be applied.

The ellipse produced by the decomposition='crosses' is often but not always identical to that with decomposition=None. The method is based on an adaption of algorithm 1 given in [1].

Examples

from skimage.morphology import footprints
footprints.ellipse(5, 3)

Aliases

  • skimage.morphology.ellipse