stroke op• Data kinds: image2d → table
• Call: import fullseye as fs; fs.ledger.swt_map(img, dark_on_light: 'bool' = True, sigma: 'float' = 1.0, max_width: 'int' = 64, angle_tol: 'float' = 0.5235987755982988) (to call the implementation directly, import textregion; textregion.swt_map(img, dark_on_light: 'bool' = True, sigma: 'float' = 1.0, max_width: 'int' = 64, angle_tol: 'float' = 0.5235987755982988); from the registry, opstext.get("swt_map"))
Stroke Width Transform — writes, at every pixel, the width of the stroke that contains it.
From the boundary pixels on the stroke side, rays are cast along the gradient direction into the inside of the character, and when one hits an opposing boundary pixel (gradient roughly opposite), the width (distance between the centres of the boundary pixels + 1) is written to every pixel on the ray (keeping the smaller value if a smaller one is already there). Following Epshtein 2010 §3, a 2nd pass replaces values on the ray larger than the ray's median with the median (suppressing overestimates at corners). The edge convention is described in _edges_and_gradient (for a rectangular stroke the width is exactly an integer).
Returns dict: swt (array of widths, 0 outside strokes) / edges / n_rays / n_hits (number of rays that hit an opposing edge).
• 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.
• poc_text_region_truth — py -3.11 examples/poc_text_region_truth.py
table as input)stroke)—
*Provenance: textregion.py — TEXT 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.