skimage 0.17.2

ParametersReturnsBackRef
shape_index(image, sigma=1, mode='constant', cval=0)

The shape index, as defined by Koenderink & van Doorn , is a single valued measure of local curvature, assuming the image as a 3D plane with intensities representing heights.

It is derived from the eigen values of the Hessian, and its value ranges from -1 to 1 (and is undefined (=NaN) in flat regions), with following ranges representing following shapes:

.. table:: Ranges of the shape index and corresponding shapes.
    ===================  =============
    Interval (s in ...)  Shape
    ===================  =============
    [  -1, -7/8)         Spherical cup
    [-7/8, -5/8)         Through
    [-5/8, -3/8)         Rut
    [-3/8, -1/8)         Saddle rut
    [-1/8, +1/8)         Saddle
    [+1/8, +3/8)         Saddle ridge
    [+3/8, +5/8)         Ridge
    [+5/8, +7/8)         Dome
    [+7/8,   +1]         Spherical cap
    ===================  =============

Parameters

image : ndarray

Input image.

sigma : float, optional

Standard deviation used for the Gaussian kernel, which is used for smoothing the input data before Hessian eigen value calculation.

mode : {'constant', 'reflect', 'wrap', 'nearest', 'mirror'}, optional

How to handle values outside the image borders

cval : float, optional

Used in conjunction with mode 'constant', the value outside the image boundaries.

Returns

s : ndarray

Shape index

Compute the shape index.

Examples

This example is valid syntax, but we were not able to check execution
>>> from skimage.feature import shape_index
... square = np.zeros((5, 5))
... square[2, 2] = 4
... s = shape_index(square, sigma=0.1)
... s array([[ nan, nan, -0.5, nan, nan], [ nan, -0. , nan, -0. , nan], [-0.5, nan, -1. , nan, -0.5], [ nan, -0. , nan, -0. , nan], [ nan, nan, -0.5, nan, nan]])
See :

Back References

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

skimage.feature.corner.shape_index

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/feature/corner.py#328
type: <class 'function'>
Commit: