ocr op• Data kinds: image2d → table
• Call: import fullseye as fs; fs.ledger.ocr_segment_line(image, char_height_px=None, dot_font=None) -> 'dict' (to call the implementation directly, import ocrclassic; ocrclassic.ocr_segment_line(image, char_height_px=None, dot_font=None) -> 'dict'; from the registry, opssymbol.get("ocr_segment_line"))
• GPU: none (CPU reference implementation only)
Segment one text line into a bounding box per character (table).
> The detailed description below is the original text — the summary and the headings are translated.
手順: 大津で地とインクの代表値(中央値)→ インク量の地図 → 字の画素 = インク量 >= 0.5 → 雑音点の除去 → (ドット書体なら) 列射影にドットピッチ 0.6 倍の 1-D closing で 1 字のドットをまとめる → 列射影の切れ目で区間化 → 想定送り幅で断片を併合・接触字を分割(射影の谷)→ 字の画素が 0.02 h^2 未満の区間を捨てる。等幅(固定ピッチ)印字を前提とする。幾何だけの分割なので、ぼけで接触した字は ocr_read_line が認識で切り直す。Otsu class medians -> ink map -> glyph pixels (ink >= 0.5) -> speck removal -> (dot font) 1-D closing of the column projection (0.6 x dot pitch) -> runs -> merge / split by expected pitch -> drop pieces < 0.02 h^2 pixels. Assumes fixed-pitch print.
image : 2-D 灰色(float 0..1 か uint8)。暗いインク・明るい地(逆なら縁から自動反転)。
char_height_px : 字高の既知値。None なら行のインクの縦幅から推定
(★行が - . だけだと過小推定になる —— 既知なら渡すこと)。
dot_font : True/False/None(None = 連結成分の大きさで自動判定)。
dict
boxes 左→右の (r0, c0, r1, c1)(終端は含まない), threshold(大津の閾値、
雑音があれば 0.7 px 平滑後の画像に対する値。字の画素の判定には使わない参考値),
line_box, char_height_px(使った値), pitch_px(推定送り幅), dot_font。
白紙(インクと地の分離が雑音 4σ 未満)は fail-soft で boxes == [],
line_box is None。
ValueError
NaN/inf、2-D 以外、数値でない、4x4 未満。
• 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_symbol_lot_ocr — py -3.11 examples/poc_symbol_lot_ocr.py
table as input)render_symbol · symbol_read_trials · symbol_read_pod · ocr_classify · ocr_read_line · ocr_read_trials
ocr)ocr_font · ocr_render_text · ocr_features · ocr_train · ocr_classify · ocr_read_line · ocr_score · ocr_read_trials
*Provenance: ocrclassic.py — SYMBOL 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.