skimage 0.17.2

NotesParametersReturns
convex_hull_object(image, neighbors=None, *, connectivity=None)

The convex hull is the set of pixels included in the smallest convex polygon that surround all white pixels in the input image.

Notes

This function uses skimage.morphology.label to define unique objects, finds the convex hull of each using convex_hull_image , and combines these regions with logical OR. Be aware the convex hulls of unconnected objects may overlap in the result. If this is suspected, consider using convex_hull_image separately on each object or adjust connectivity .

Parameters

image : (M, N) ndarray

Binary input image.

neighbors : {4, 8}, int, optional

Whether to use 4 or 8 adjacent pixels as neighbors. If None , set to 8. Deprecated, use connectivity instead.

connectivity : {1, 2}, int, optional

Determines the neighbors of each pixel. Adjacent elements within a squared distance of connectivity from pixel center are considered neighbors. If None , set to 2:

1-connectivity      2-connectivity
      [ ]           [ ]  [ ]  [ ]
       |               \  |  /
 [ ]--[x]--[ ]      [ ]--[x]--[ ]
       |               /  |  \
      [ ]           [ ]  [ ]  [ ]

Returns

hull : ndarray of bool

Binary image with pixels inside convex hull set to True .

Compute the convex hull image of individual objects in a binary image.

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/morphology/convex_hull.py#96
type: <class 'function'>
Commit: