blob_boundaries — BLOB extract op

• Data kinds: labels2d → mask

• Call: import fullseye as fs; fs.ledger.blob_boundaries(labels: 'Any') -> 'np.ndarray' (to call the implementation directly, import blob2d; blob2d.blob_boundaries(labels: 'Any') -> 'np.ndarray'; from the registry, opsblob.get("blob_boundaries"))

Usage

Object outlines (1 pixel wide, bool). The borders between adjacent objects are kept as well.

It takes the inner border (foreground pixels adjacent to a label different from their own), so the contour always lies inside the object -- taking the outer side would mean calling pixels of the neighbouring object a contour.

Procedure: apply a 3x3 (8-neighbourhood) grey erosion lo and dilation hi to the label image, then (labels > 0) & ((lo != labels) | (hi != labels)). "Foreground pixels with a different number in their neighbourhood (including background 0)" = the inner border, 1 pixel wide. With erosion alone, the boundary on the side of the object with the smaller number disappears, so dilation is also checked to make it symmetric.

• labels: 2-D integer label image (output of blob_label). bool / float / negative numbers raise ValueError (same contract as blob_region).

• Returns: bool of shape (H, W). The borders of all objects overlap in 1 sheet (if you want them per object, extract with blob_region first and then apply).

• For objects touching the image border, scipy's default (reflective boundary) treats the outside of the image edge as their own value, so sides running along the image edge do not appear as border.

• A thin object 1 pixel wide has all its pixels on the border.

The perimeter in blob_features is measured with a separate coefficient method and does not match the pixel count of this border. To use the contour as a polyline, annotate_outline_layout returns an (x, y) closed polygon.

Detailed usage guide

• blob_analysis family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_gear_tooth_metrology — py -3.11 examples/poc_gear_tooth_metrology.py

Ops the type connects to (they accept mask as input)

blob_label · blob_distance

Same category (extract)

blob_region · blob_overlay


*Provenance: blob2d.py — BLOB operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.