code wiki / (root) / nx_haar_cascade.nx

nx_haar_cascade.nx

buildroot/runtime/nx_haar_cascade.nx

2472 B59 linesdepth 7pulls 8 transitivereach 1 importersview sourcekind librarytopic haar
docsdependenciesstructsconstsfunctions

about

nx_haar_cascade.nx -- Viola-Jones attentional cascade EVALUATOR (R-FACE-2). The detector engine: a weak classifier is a Haar feature + threshold + polarity; a stage sums weighted weak votes vs a stage threshold; the cascade runs stages in order and EARLY-REJECTS the moment any stage fails (so the vast non-object majority is discarded after 1-2 cheap stages). This evaluates a GIVEN cascade. The cascade PARAMETERS (thresholds/polarities/ alphas/stage thresholds) come from TRAINING (AdaBoost over a labeled face / non-face set) -- a separate data-dependent rung. This rung is the machinery, validated with a hand-built toy cascade. Layout (caller-supplied flat i64 arrays): weak row (8 i64): [kind, x, y, w, h, threshold, polarity(+1/-1), alpha] stage row (3 i64): [weak_offset(in rows), weak_count, stage_threshold] genealogy_id: viola_jones_2001_attentional_cascade + freund_schapire_adaboost_1997 lineage_id: weak_classifier + boosted_stage + early_reject_cascade license_tier: ORIGINAL

dependencies 4 imports · 1 importers

syscalls.nx nx_image.nx nx_integral.nx nx_haar.nx nx_haar_cascade.nx nx_haar_cascade_gate.nx

imports: syscalls.nxnx_image.nxnx_integral.nxnx_haar.nx

imported by: nx_haar_cascade_gate.nx

structs

none

consts

24const NX_WEAK_FIELDS: i64 = 8
25const NX_STAGE_FIELDS: i64 = 3

functions

29func nx_weak_eval(ii: *IntegralImage, weak: *i64) -> i64
called by 1: nx_stage_eval calls 1: nx_haar_eval
37func nx_stage_eval(ii: *IntegralImage, weaks: *i64, n: i64, stage_thresh: i64) -> i64
50func nx_haar_cascade_eval(ii: *IntegralImage, stages: *i64, n_stages: i64, weaks: *i64) -> i64
called by 1: main calls 1: nx_stage_eval