skimage 0.17.2

ParametersReturnsBackRef
rank_order(image)

Parameters

image : ndarray

Returns

labels : ndarray of type np.uint32, of shape image.shape

New array where each pixel has the rank-order value of the corresponding pixel in image . Pixel values are between 0 and n - 1, where n is the number of distinct unique values in image .

original_values : 1-D ndarray

Unique original values of image

Return an image of the same shape where each pixel is the index of the pixel value in the ascending order of the unique values of image , aka the rank-order value.

Examples

This example is valid syntax, but we were not able to check execution
>>> a = np.array([[1, 4, 5], [4, 4, 1], [5, 1, 1]])
... a array([[1, 4, 5], [4, 4, 1], [5, 1, 1]])
This example is valid syntax, but we were not able to check execution
>>> rank_order(a)
(array([[0, 1, 2],
       [1, 1, 0],
       [2, 0, 0]], dtype=uint32), array([1, 4, 5]))
This example is valid syntax, but we were not able to check execution
>>> b = np.array([-1., 2.5, 3.1, 2.5])
... rank_order(b) (array([0, 1, 2, 1], dtype=uint32), array([-1. , 2.5, 3.1]))
See :

Back References

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

skimage.filters._rank_order.rank_order

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/filters/_rank_order.py#14
type: <class 'function'>
Commit: