nx_lash_transition.nx
buildroot/runtime/nx_lash_transition.nx
about
nx_lash_transition.nx -- eyelid-to-lash edge gradient softness.
Mannequin face marker: lashes meet eyelid as a hard sharp line
(rendered as a discrete edge). Real lashes fade softly into the
eyelid skin tone over 2-3 pixels of micro-blur.
Math:
Within the eyelid band (3-5 px ABOVE the iris top), measure
per-column vertical luminance gradient |Y(y) - Y(y-1)| and
accumulate. High mean gradient = sharp line = MANNEQUIN.
Low mean gradient = soft fade = NATURAL.
Output flat-array:
result[0] = pixel_count
result[1] = mean_gradient
result[2] = max_gradient
result[3] = hard_transitions (count of gradients > HARD_THRESH)
result[4] = verdict (0=MANNEQUIN, 1=AMBIGUOUS, 2=NATURAL)
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_image.nx
imported by: nx_lash_transition_test.nx
structs
| none |
consts
| 29 | const NX_LASH_RES_PIXELS: i64 = 0 |
| 30 | const NX_LASH_RES_MEAN_GRAD: i64 = 1 |
| 31 | const NX_LASH_RES_MAX_GRAD: i64 = 2 |
| 32 | const NX_LASH_RES_HARD_TRANS: i64 = 3 |
| 33 | const NX_LASH_RES_VERDICT: i64 = 4 |
| 34 | const NX_LASH_RES_FIELDS: i64 = 5 |
| 36 | const NX_LASH_VERDICT_MANNEQUIN: i64 = 0 |
| 37 | const NX_LASH_VERDICT_AMBIGUOUS: i64 = 1 |
| 38 | const NX_LASH_VERDICT_NATURAL: i64 = 2 |
| 41 | const NX_LASH_HARD_THRESH: i64 = 60 |
| 42 | const NX_LASH_MEAN_NATURAL_MAX: i64 = 25 // mean gradient ≤ 25 = soft NATURAL |
| 43 | const NX_LASH_MEAN_MANNEQUIN_MIN: i64 = 45 // mean gradient ≥ 45 = sharp MANNEQUIN |
functions
| 46 | func nx_lash_lum(rgb: *Image, x: i64, y: i64) -> i64 |
| 60 | func nx_lash_transition(rgb: *Image, bbox: *i64, band_height: i64, |