This is a development version (0.26.1rc0.dev0) and may be unstable.Go to latest (0.26.1rc0.dev0+git20260530.b607368ff)
{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0 / skimage / measure / _regionprops / perimeter

function

skimage.measure._regionprops:perimeter

source: /_skimage2/measure/_regionprops_utils.py:417

Signature

def perimeter(image, neighborhood = 4)

Summary

Calculate total perimeter of all objects in binary image.

Parameters

image : ndarray of shape (M, N)

Binary input image.

neighborhood : 4 or 8, optional

Neighborhood connectivity for border pixel determination. It is used to compute the contour. A higher neighborhood widens the border on which the perimeter is computed.

Returns

perimeter : float

Total perimeter of all objects in binary image.

Examples

import skimage as ski
img_coins = ski.data.coins() > 110
✓
ski.measure.perimeter(img_coins, neighborhood=4)  # doctest: +ELLIPSIS
ski.measure.perimeter(img_coins, neighborhood=8)  # doctest: +ELLIPSIS
✗
np.float64(8806.268073325286)

Aliases

  • skimage.measure.perimeter