{ } Raw JSON

bundles / skimage latest / skimage / morphology / convex_hull / convex_hull_object

function

skimage.morphology.convex_hull:convex_hull_object

source: /dev/scikit-image/src/skimage/morphology/convex_hull.py :173

Signature

def   convex_hull_object ( image * connectivity = 2 )

Summary

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

Extended Summary

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

Parameters

image : ndarray of shape (M, N)

Binary input image.

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.

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

Returns

hull : ndarray of bool

Binary image with pixels inside convex hull set to True.

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.

Aliases

  • skimage.morphology.convex_hull_object

Referenced by