skimage2.morphology.convex_hull_object#
- skimage2.morphology.convex_hull_object(image, *, connectivity=2)[source]#
Compute the convex hull image of individual objects in a binary image.
The convex hull is the set of pixels included in the smallest convex polygon that surround all white pixels in the input image.
- Parameters:
- imagendarray 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
connectivityfrom pixel center are considered neighbors.:1-connectivity 2-connectivity [ ] [ ] [ ] [ ] | \ | / [ ]--[x]--[ ] [ ]--[x]--[ ] | / | \ [ ] [ ] [ ] [ ]
- Returns:
- hullndarray of bool
Binary image with pixels inside convex hull set to
True.
Notes
This function uses
skimage.morphology.labelto define unique objects, finds the convex hull of each usingconvex_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 adjustconnectivity.