Segmentation#

segment() partitions an image into labelled regions (for example the sand layers of a FluidFlower rig) using a watershed on a gradient or monochromatic signal. The remaining helpers manage label arrays produced by segmentation.

segment(img[, markers_method, edges_method, ...])

Segment an image using watershed segmentation, with denoising.

label_image(img[, map, ctol, ...])

Segment an image by matching pixel colours to a reference map.

group_labels(labels, groups[, values])

Unite labels in the given groups.

reassign_labels(labels, mapping)

Reassign labels according to the provided mapping.

make_consecutive(labels)

Ensure that labels in the image are consecutive integers starting from 0.

Masks#

Masks(labels[, return_label])

Iterable object converting a label imaged to masks.

roi_to_mask(roi, reference_image[, mode])

Create a full-domain boolean mask image from one or more bounding-box ROIs.