code wiki / (root) / nx_presence.nx

nx_presence.nx

buildroot/runtime/nx_presence.nx

4638 B121 linesdepth 5pulls 6 transitivereach 11 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_presence.nx -- person-presence detection (skin-chrominance + blob concentration). R2 of the MEDIA-STUDIO arc, and the TRUE dead-air signal: motion alone is not enough -- a moving curtain or a TV showing scenery is still "dead air" because no PERSON is onscreen. A person presents a coherent region of skin tone; empty rooms, moving non-person objects, and scattered skin-coloured noise do not. Two cheap, sovereign signals (pure integer, no learned weights): skin per-mille : fraction of pixels inside the skin-chrominance gamut. concentration : skin pixels / area of their bounding box, per-mille. A solid blob fills its own box (high); scattered skin- coloured speckle spans a huge box but fills little (low). PRESENT iff skin >= min_skin AND concentration >= min_conc. The skin gamut is the Kovac et al. 2003 uniform-daylight rule (a fixed colour-science test, documented below). The DECISION thresholds (min_skin, min_conc) are CALLER-supplied -- those are the business knobs. genealogy_id: kovac_2003_skin_segmentation + connected_region_density (attribution UNVERIFIED -- record-hint, do not cite as sourced) lineage_id: skin_chrominance_rule + bounding_box_density + threshold nx_safety_envelope: intended_use: "Flag whether a person is onscreen, for dead-air trimming and as the front-end of body/aesthetic analysis." verdict: NOT_YET_EVALUATED license_tier: ORIGINAL

dependencies 2 imports · 6 importers

syscalls.nx nx_image.nx nx_presence.nx nx_blob.nx nx_blob_gate.nx nx_media_index.nx nx_media_run.nx nx_media_run_gate.nx nx_presence_gate.nx

imports: syscalls.nxnx_image.nx

imported by: nx_blob.nxnx_blob_gate.nxnx_media_index.nxnx_media_run.nxnx_media_run_gate.nxnx_presence_gate.nx

structs

none

consts

31const NX_PRES_PRESENT: i64 = 1
32const NX_PRES_ABSENT: i64 = 0
39const NX_PRES_MIN_FILL: i64 = 300

functions

43func nx_skin_is_pixel(r: i64, g: i64, b: i64) -> i64
66func nx_presence_scan(img: *Image, out: *i64) -> i64
116func nx_presence_classify(skin_permille: i64, conc_permille: i64, min_skin: i64, min_conc: i64) -> i64