skimage 0.17.2

ParametersRaisesReturns
_generate_rectangle_mask(point, image, shape, random)

The height and width of the rectangle are generated randomly.

Parameters

point : tuple

The row and column of the top left corner of the rectangle.

image : tuple

The height, width and depth of the image into which the shape is placed.

shape : tuple

The minimum and maximum size of the shape to fit.

random : np.random.RandomState

The random state to use for random sampling.

Raises

ArithmeticError

When a shape cannot be fit into the image with the given starting coordinates. This usually means the image dimensions are too small or shape dimensions too large.

Returns

label : tuple

A (category, ((r0, r1), (c0, c1))) tuple specifying the category and bounding box coordinates of the shape.

indices : 2-D array

A mask of indices that the shape fills.

Generate a mask for a filled rectangle shape.

Examples

See :

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/draw/_random_shapes.py#9
type: <class 'function'>
Commit: