ocr_features — SYMBOL ocr op

• Data kinds: image2d → signal

• Call: import fullseye as fs; fs.ledger.ocr_features(glyph_image) -> 'np.ndarray' (to call the implementation directly, import ocrclassic; ocrclassic.ocr_features(glyph_image) -> 'np.ndarray'; from the registry, opssymbol.get("ocr_features"))

• GPU: none (CPU reference implementation only)

Usage

Build the 88-D feature vector (zoning densities + projections) from the ink map of one glyph (signal).

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

入力の約束 / Input contract

glyph_image はインク量の地図(1 = インク、0 = 地、float)で、

行は字高の範囲(行の上端〜下端)、列はその字を含む範囲を切り出したもの

(ocr_read_line はインク重心を中心に送り幅 1 つぶんの幅で切る)。

行を字高にそろえるので . - : の縦位置と大きさが特徴量に残る

(インクの外接箱で正規化すると . は大きな円板になり、何にでも似てしまう)。

正規化 / Normalisation

縦: 切り出しの高さを FEATURE_GRID (24) 画素に拡縮。横: 同じ倍率(縦横比保持)で、

インクの重心列をキャンバス中央に置く(字幅を推定しないので、ぼけで箱が太っても位置がずれない)。

縮小時は先に Gaussian で前置平滑(エイリアス防止)し、map_coordinates(双線形)で標本化。

構成 / Layout (length FEATURE_LENGTH = 88)

[0:64] 8x8 区画濃度(各 3x3 画素の平均インク、0..1)/ zoning densities

[64:76] 水平射影(行方向の平均インク、12 ビン)/ horizontal projection profile

[76:88] 垂直射影(列方向の平均インク、12 ビン)/ vertical projection profile

交差数(crossing count)は使わない: 離散値で、ぼけとドットの途切れに不安定なため。Crossing counts are not used: they are discrete and unstable under blur / dot gaps.

インクが無ければ全 0 を返す。/ Returns zeros for an empty glyph.

Detailed usage guide

• symbol_reading 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_symbol_lot_ocr — py -3.11 examples/poc_symbol_lot_ocr.py

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

decode_barcode_profile · grade_barcode_profile

Same category (ocr)

ocr_font · ocr_render_text · ocr_segment_line · 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.