nx_ocr_classify.nx
buildroot/runtime/nx_ocr_classify.nx
about
nx_ocr_classify.nx -- R4 of the sovereign scanning stack: glyph box -> character. The recognition core: resample
a segmented glyph (its bbox in the binary image) to a fixed GW x GH grid, then classify by NEAREST-NEIGHBOUR
(minimum Hamming distance) against a template set. This is classical template-match OCR for MACHINE PRINT --
integer-exact, zero deps, no ML. Coverage/accuracy grows with the template set (later rungs); this rung proves the
mechanism. R5 assembles recognised chars into text -> nx_money_ledger -> money-OS. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_ocr_classify_gate.nx
structs
| none |
consts
| none |
functions
| 10 | func ocr_resample(pix: *u8, w: i64, minx: i64, miny: i64, bw: i64, bh: i64, gw: i64, gh: i64, cell: *i64) -> i64 called by 1: main |
| 28 | func ocr_hamming(a: *i64, b: *i64, ncells: i64) -> i64 |
| 36 | func ocr_classify(cell: *i64, ncells: i64, templates: *i64, ntempl: i64, best_out: *i64) -> i64 |