{ } Raw JSON

bundles / skimage latest / skimage / measure / _regionprops_utils / perimeter_crofton

function

skimage.measure._regionprops_utils:perimeter_crofton

source: /dev/scikit-image/src/skimage/measure/_regionprops_utils.py:484

Signature

def perimeter_crofton(image, directions = 4)

Summary

Calculate total Crofton perimeter of all objects in binary image.

Parameters

image : ndarray of shape (M, N)

Input image. If image is not binary, all values greater than zero are considered as the object.

directions : 2 or 4, optional

Number of directions used to approximate the Crofton perimeter. By default, 4 is used: it should be more accurate than 2. Computation time is the same in both cases.

Returns

perimeter : float

Total perimeter of all objects in binary image.

Notes

This measure is based on Crofton formula [1], which is a measure from integral geometry. It is defined for general curve length evaluation via a double integral along all directions. In a discrete space, 2 or 4 directions give a quite good approximation, 4 being more accurate than 2 for more complex shapes.

Similar to perimeter, this function returns an approximation of the perimeter in continuous space.

Examples

import skimage as ski
img_coins = ski.data.coins() > 110
✓
ski.measure.perimeter_crofton(img_coins, directions=2)  # doctest: +ELLIPSIS
ski.measure.perimeter_crofton(img_coins, directions=4)  # doctest: +ELLIPSIS
✗

Aliases

  • skimage.measure.perimeter_crofton