swt_map — TEXT 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"))

Usage

Stroke Width Transform — writes, at every pixel, the width of the stroke that contains it.

> The detailed description below is the original text — the summary and the headings are translated.

文字側の境界画素から、勾配の向きに沿って文字の内側へ光線を飛ばし、向かい合う境界

画素(勾配がほぼ逆向き)に当たったら、光線上の全画素に幅(境界画素の中心間距離 + 1)

を書く(既に小さい値があれば小さい方)。Epshtein 2010 §3 の手順で、2 回目の走査で

光線上の中央値より大きい値を中央値に置き換える(角の過大を抑える)。エッジの規約は

:func:_edges_and_gradient に書いた(矩形ストロークで幅が厳密に整数になる)。

Returns dict: `swt(幅の配列、ストローク外は 0)/ edges / n_rays` /

`n_hits`(向かい合うエッジに当たった光線の数)。

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_text_region_truth — py -3.11 examples/poc_text_region_truth.py

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

text_lines

Same category (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.