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:
- img
darsia.Image Segmented image with boolean or integer values.
- roi
np.ndarray Set of points, for which a bounding box defines a ROI.
- values_of_interest
intorlistofint 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.
- img
- Returns:
floatContour length in metric units based on the coordinate system of the input image.