code wiki / (root) / nx_facefind_lib.nx

nx_facefind_lib.nx

buildroot/runtime/nx_facefind_lib.nx

9914 B203 linesdepth 9pulls 10 transitivereach 20 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_facefind_lib.nx -- FACE AND EYE BOXES from a gray plane (aesthetictwin AT30, 2026-09-16): the loaded cascades (nx_haar_xml) run by the sovereign evaluator (nx_haar_cascade) over integral tables (nx_integral). The face is the best-voted group over the whole plane at window sizes from min_face_permil of the shorter side; the eyes are the best-voted groups on each half of the face's eye band. Every count the verdict rests on travels in the result (raw detections, groups, the cap flag) so a miss can be read, never guessed. The trained data is a beta-only bootstrap arm; this composite is written against the flat cascade layout, so a cascade the estate trains itself drops in unchanged. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 4 imports · 3 importers

nx_syscalls.nx nx_integral.nx nx_haar_cascade.nx nx_haar_xml.nx nx_facefind_lib.nx nx_facefind.nx nx_facefind_gate.nx nx_photomark_lib.nx

imports: nx_syscalls.nxnx_integral.nxnx_haar_cascade.nxnx_haar_xml.nx

imported by: nx_facefind.nxnx_facefind_gate.nxnx_photomark_lib.nx

structs

none

consts

13const FF_FACE_XML: *u8 = "knowledge/fetched/cmp_aesthetictwin_haar_frontalface_default.xml"
14const FF_FACE_XML_PARENT: *u8 = "../knowledge/fetched/cmp_aesthetictwin_haar_frontalface_default.xml"
15const FF_EYE_XML: *u8 = "knowledge/fetched/cmp_aesthetictwin_haar_eye.xml"
16const FF_EYE_XML_PARENT: *u8 = "../knowledge/fetched/cmp_aesthetictwin_haar_eye.xml"
17const FF_MIN_FACE_PERMIL: i64 = 100
18const FF_SCALE_PERMIL: i64 = 1100
19const FF_DET_CAP: i64 = 4096
20const FF_GRP_CAP: i64 = 512
21const FF_MIN_NEIGHBORS: i64 = 3
22const FF_GROUP_EPS_PERMIL: i64 = 200
23const FF_EYE_TOP_PERMIL: i64 = 150
24const FF_EYE_BOT_PERMIL: i64 = 600
25const FF_EYE_MIN_DIV: i64 = 10
26const FF_EYE_MAX_DIV: i64 = 3
27const FF_EYE_MIN_NEIGHBORS: i64 = 2
28const FF_PERMIL: i64 = 1000
29const FF_I64: i64 = 8
30const FF_R_FACE: i64 = 0
31const FF_R_FX: i64 = 1
32const FF_R_FY: i64 = 2
33const FF_R_FW: i64 = 3
34const FF_R_FH: i64 = 4
35const FF_R_FVOTES: i64 = 5
36const FF_R_EYES: i64 = 6
37const FF_R_RX: i64 = 7
38const FF_R_RY: i64 = 8
39const FF_R_RW: i64 = 9
40const FF_R_RH: i64 = 10
41const FF_R_LX: i64 = 11
42const FF_R_LY: i64 = 12
43const FF_R_LW: i64 = 13
44const FF_R_LH: i64 = 14
45const FF_R_GROUPS: i64 = 15
46const FF_R_RAW: i64 = 16
47const FF_R_CAPPED: i64 = 17
48const FF_R_EYE_RAW: i64 = 18
49const FF_R_EYE_GROUPS: i64 = 19
50const FF_R_FACE_RANK: i64 = 20
51const FF_R_RVOTES: i64 = 21
52const FF_R_LVOTES: i64 = 22
53const FF_R_N: i64 = 23
54const FF_FACE_CANDIDATES: i64 = 4
55const FF_JOINT_MIN_PERMIL: i64 = 500
56const FF_E_RAW: i64 = 0
57const FF_E_GROUPS: i64 = 1
58const FF_E_RX: i64 = 2
59const FF_E_RY: i64 = 3
60const FF_E_RW: i64 = 4
61const FF_E_RH: i64 = 5
62const FF_E_RV: i64 = 6
63const FF_E_LX: i64 = 7
64const FF_E_LY: i64 = 8
65const FF_E_LW: i64 = 9
66const FF_E_LH: i64 = 10
67const FF_E_LV: i64 = 11
68const FF_E_VOTE_OFF: i64 = 4
69const FF_EYE_OUT_N: i64 = 12
70const FF_OK: i64 = 0
71const FF_E_NOFACE: i64 = 0 - 1
72const FF_E_NOEYES: i64 = 0 - 2

functions

74func ff_min(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 1: ff_find
75func ff_load_face(rc: *i64) -> *HaarCascade { var c: *HaarCascade = hx_load(FF_FACE_XML, rc); if (c as i64) == 0 { c = hx_load(FF_FACE_XML_PARENT, rc) } return c }
76func ff_load_eye(rc: *i64) -> *HaarCascade { var c: *HaarCascade = hx_load(FF_EYE_XML, rc); if (c as i64) == 0 { c = hx_load(FF_EYE_XML_PARENT, rc) } return c }
79func ff_find(face_c: *HaarCascade, eye_c: *HaarCascade, gray: *u8, w: i64, h: i64, stride: i64, min_face_permil: i64, res: *i64) -> i64
148func ff_eyes(eye_c: *HaarCascade, ii: *IntegralImage, sq: *IntegralImage, fx: i64, fy: i64, fw: i64, fh: i64, out: *i64) -> i64
177func ff_half_mean(egroups: *i64, neg: i64, mid: i64, side: i64, floor: i64, out: *i64, slot: i64) -> i64
called by 1: ff_eyes