darsia.group_labels#

group_labels(labels, groups, values=None)[source]#

Unite labels in the given groups.

Parameters:
labelsdarsia.Image

Labeled image with integer labels.

groupslist[list[int]]

List of groups, where each group is a list of labels to be united. The first label in each group is the label to which all other labels in the group will be united.

valueslist[int], optional

Value to assign to each group instead of its first label; if None (default), each group is united under its own first label.