Skip to main content

labels_to_svg

Signature
def labels_to_svg(
data: npt.NDArray[np.uint8],
labels: npt.NDArray[int],
min_area: int,
min_thickness: int,
) -> str

Convert labels to an SVG string.

Parameters

NameTypeDescription
datanumpy.ndarrayInput image data as a uint8 numpy array.
labelsnumpy.ndarrayLabel map as an int32 numpy array.
min_areaintMinimum cluster area to include in the SVG.
min_thicknessintMinimum thickness a region must have to include in the SVG.

Returns

TypeDescription
strAn SVG string containing data roughly approximate to the input image.