skimage 0.17.2

ParametersReturnsBackRef
h_minima(image, h, selem=None)

The local minima are defined as connected sets of pixels with equal grey level strictly smaller than the grey levels of all pixels in direct neighborhood of the set.

A local minimum M of depth h is a local minimum for which there is at least one path joining M with a deeper minimum on which the maximal value is f(M) + h (i.e. the values along the path are not increasing by more than h with respect to the minimum's value) and no path for which the maximal value is smaller.

Parameters

image : ndarray

The input image for which the minima are to be calculated.

h : unsigned integer

The minimal depth of all extracted minima.

selem : ndarray, optional

The neighborhood expressed as an n-D array of 1's and 0's. Default is the ball of radius 1 according to the maximum norm (i.e. a 3x3 square for 2D images, a 3x3x3 cube for 3D images, etc.)

Returns

h_min : ndarray

The minima of depth >= h. The resulting image is a binary image, where pixels belonging to the selected minima take value 1, the other pixels take value 0.

Determine all minima of the image with depth >= h.

See Also

skimage.morphology.extrema.h_maxima
skimage.morphology.extrema.local_maxima
skimage.morphology.extrema.local_minima

Examples

This example is valid syntax, but we were not able to check execution
>>> import numpy as np
... from skimage.morphology import extrema

We create an image (quadratic function with a minimum in the center and 4 additional constant maxima. The depth of the minima are: 1, 21, 41, 61, 81

This example is valid syntax, but we were not able to check execution
>>> w = 10
... x, y = np.mgrid[0:w,0:w]
... f = 180 + 0.2*((x - w/2)**2 + (y-w/2)**2)
... f[2:4,2:4] = 160; f[2:4,7:9] = 140; f[7:9,2:4] = 120; f[7:9,7:9] = 100
... f = f.astype(np.int)

We can calculate all minima with a depth of at least 40:

This example is valid syntax, but we were not able to check execution
>>> minima = extrema.h_minima(f, 40)

The resulting image will contain 3 local minima.

See :

Back References

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

skimage.morphology.extrema.local_maxima skimage.morphology.extrema.h_minima skimage.morphology.extrema.h_maxima skimage.morphology.extrema.local_minima

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/extrema.py#173
type: <class 'function'>
Commit: