nx_img_threshold.nx
buildroot/runtime/nx_img_threshold.nx
about
nx_img_threshold.nx -- R2 of the sovereign scanning stack: grayscale -> binary (ink/paper). Otsu's method finds
the intensity threshold that maximizes between-class variance (the optimal split of a bimodal page histogram),
then binarizes to 0 (ink) / 255 (paper). Integer-exact (integer class means; no floats). Composes R1's
img_histogram. This is what turns a scanned page into clean text-vs-background for R3 segmentation. license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_img_core.nx
imported by: nx_img_segment.nxnx_img_threshold_gate.nx
structs
| none |
consts
| none |
functions
| 9 | func thr_otsu(hist: *i64, npix: i64) -> i64 called by 1: thr_otsu_of |
| 37 | func thr_otsu_of(pix: *u8, npix: i64) -> i64 |
| 44 | func thr_binarize(pix: *u8, npix: i64, t: i64) -> i64 called by 1: main |