code wiki / _hdl_build / nx_silhouette.nx

nx_silhouette.nx

buildroot/runtime/_hdl_build/nx_silhouette.nx

35008 B582 linesdepth 10pulls 46 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_silhouette.nx -- ★★★PHOTO -> OUTLINE PROFILE: the missing link between a reference figure and a number. WHY THIS EXISTS. The curvature metric reads 3D geometry, so a photograph -- which is what every reference figure actually is -- could not be measured at all. That left "aim at this figure" as an instruction with no arithmetic behind it. This organ closes that: a photo becomes a half-width profile, and the profile goes into the SAME curvature measurement the meshes use. ★★ONE CURVATURE IMPLEMENTATION, TWO SOURCES. This organ deliberately does NOT compute curvature. It emits a profile; nx_curvebench measures it. A second copy of the metric living here is how a photo target and a mesh score would quietly drift onto different scales and stop being comparable -- which would defeat the entire point of extracting an aim point in the first place. ★★AND IT IS THE SAME PIECE THE TWIN LOOP NEEDS. Registration (bringing a subject and the model into one frame) starts from exactly this: the subject's outline. So the beauty lane and the capture ladder turn out to want one capability, which is the second time in this programme that two goals have collapsed into one rung. SEGMENTATION: skin classified in CHROMA, not in brightness. The classic robust rule -- skin occupies a compact region in Cb/Cr almost independently of lightness -- which is why it survives the hard sun-and-shade mixtures in outdoor reference photography where a brightness threshold would cut the figure in half at the shadow line. ★HONEST SCOPE, stated because it decides where this may be pointed: this works on a figure against a non-skin background. It is not a general matting solution, it will fail on skin-toned backgrounds, sand, and tanned wood, and T3 exists to prove it at least REFUSES rather than inventing a body. nx_silhouette profile <image> <out.prof> [bands] -> half-width profile + coverage nx_silhouette selftest license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_img_bytes_to_rgb.nx nx_silhouette.nx

imports: nx_gate_verdict.nxnx_img_bytes_to_rgb.nx

imported by: nobody (leaf or entry point)

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

main sl_streq sl_gate gv_ctr sys_mmap gv_head gv_puts sys_write sl_scan sl_ccl sl_is_skin sl_find sl_is_skin ↻ gv_check gv_puts ↻ sl_is_skin ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close sys_munmap ↻ sl_puts sl_atoi sys_read_file sys_openat_rd sys_lseek

structs

none

consts

30const SL_MAGIC_1000000000: i64 = 1000000000
32const SL_BANDS: i64 = 128
33const SL_PREC: i64 = 100000
34const SL_MM: i64 = 1000
35const SL_MODE: i64 = 420
38const SL_CB_LO: i64 = 77
39const SL_CB_HI: i64 = 127
40const SL_CR_LO: i64 = 133
41const SL_CR_HI: i64 = 173
42const SL_Y_LO: i64 = 40
45const SL_EDGE: i64 = 2
48const SL_MAXBLEED: i64 = 500
50const SL_MINRUN: i64 = 3
52const SL_MINCOV: i64 = 250
114const SL_MAXRUNS: i64 = 262144

functions

54func sl_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
55func sl_pn(v: i64) -> i64
called by 1: main
64func sl_streq(a: *u8, b: *u8) -> i64
called by 1: main
69func sl_atoi(s: *u8) -> i64
called by 1: main
75func sl_wint(b: *u8, pos: *i64, v: i64, c: i64) -> i64
called by 1: main
88func sl_is_skin(r: i64, g: i64, b: i64) -> i64
115func sl_find(p: *i64, x: i64) -> i64
called by 1: sl_ccl
126func sl_ccl(rgb: *u8, w: i64, h: i64, clo: *i64, chi: *i64) -> i64
called by 1: sl_scan calls 2: sl_is_skinsl_find
202func sl_scan(rgb: *u8, w: i64, h: i64, W: *i64, bands: i64) -> i64
called by 2: sl_gatemain calls 2: sl_cclsl_is_skin
333func sl_gate() -> i64
519func main(argc: i64, argv: *i64) -> i64