code wiki / (root) / nx_img_threshold_gate.nx

nx_img_threshold_gate.nx

buildroot/runtime/nx_img_threshold_gate.nx

2213 B46 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic img
docsdependenciesstructsconstsfunctions

about

nx_img_threshold_gate.nx -- proves R2 (Otsu threshold + binarize) on hand-computed images: A = bimodal [50 x3, 200 x3] -> Otsu picks 50, binarize -> 3 ink pixels B = two clusters [10,20,30 | 220,230,240] -> Otsu picks 30 (splits dark from light) Exit 0 iff all pass. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_gate.nx nx_img_threshold.nx nx_img_threshold_gate.nx

imports: nx_gate.nxnx_img_threshold.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main decode img_pgm_decode img_parse_header sys_mmap img_next_uint img_skip_ws img_is_ws sys_mmap ↻ img_next_uint ↻ chk gw sys_write gn sys_write ↻ sys_mmap ↻ thr_otsu_of sys_mmap ↻ img_histogram thr_otsu thr_binarize img_get gw ↻ gn ↻

structs

none

consts

none

functions

8func chk(name: *u8, got: i64, want: i64, st: *i64) -> i64
called by 1: main calls 2: gwgn
14func decode(src: *u8, pix: *u8, cap: i64, dims: *i64) -> i64
called by 1: main calls 1: img_pgm_decode
19func main() -> i64