code wiki / _hdl_build / nx_silhouette.nx
nx_silhouette.nx
buildroot/runtime/_hdl_build/nx_silhouette.nx
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
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
structs
| none |
consts
| 30 | const SL_MAGIC_1000000000: i64 = 1000000000 |
| 32 | const SL_BANDS: i64 = 128 |
| 33 | const SL_PREC: i64 = 100000 |
| 34 | const SL_MM: i64 = 1000 |
| 35 | const SL_MODE: i64 = 420 |
| 38 | const SL_CB_LO: i64 = 77 |
| 39 | const SL_CB_HI: i64 = 127 |
| 40 | const SL_CR_LO: i64 = 133 |
| 41 | const SL_CR_HI: i64 = 173 |
| 42 | const SL_Y_LO: i64 = 40 |
| 45 | const SL_EDGE: i64 = 2 |
| 48 | const SL_MAXBLEED: i64 = 500 |
| 50 | const SL_MINRUN: i64 = 3 |
| 52 | const SL_MINCOV: i64 = 250 |
| 114 | const SL_MAXRUNS: i64 = 262144 |
functions
| 54 | func 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 |
| 55 | func sl_pn(v: i64) -> i64 called by 1: main |
| 64 | func sl_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 69 | func sl_atoi(s: *u8) -> i64 called by 1: main |
| 75 | func sl_wint(b: *u8, pos: *i64, v: i64, c: i64) -> i64 called by 1: main |
| 88 | func sl_is_skin(r: i64, g: i64, b: i64) -> i64 |
| 115 | func sl_find(p: *i64, x: i64) -> i64 called by 1: sl_ccl |
| 126 | func sl_ccl(rgb: *u8, w: i64, h: i64, clo: *i64, chi: *i64) -> i64 |
| 202 | func sl_scan(rgb: *u8, w: i64, h: i64, W: *i64, bands: i64) -> i64 |
| 333 | func sl_gate() -> i64 |
| 519 | func main(argc: i64, argv: *i64) -> i64 |