darsia.contour_length#

contour_length(img, roi=None, values_of_interest=None, fill_holes=False, verbosity=False)[source]#

Calculation of the contour length of a segmented region.

Parameters:
imgdarsia.Image

Segmented image with boolean or integer values.

roinp.ndarray

Set of points, for which a bounding box defines a ROI.

values_of_interestint or list of int

Only active if integer-valued image provided; defines the values of interest, i.e., which part of the image is treated as active.

fill_holesbool

Flag controlling whether holes in the determined mask are filled before the contour length is computed; if not, holes are treated as contour; default is True.

verbositybool

Flag controlling whether intermediate results are plotted; default is False.

Returns:
float

Contour length in metric units based on the coordinate system of the input image.