nx_skin_pore_detail.nx
buildroot/runtime/nx_skin_pore_detail.nx
about
nx_skin_pore_detail.nx -- high-frequency pore-scale texture detector.
At 8k+ render quality real skin shows individual pores: tiny dark
micro-spots of pore-scale (1-2 px at full res) creating high-
frequency texture. Mannequin / SDXL-smooth renders suppress this:
skin is uniform within local 3x3 neighborhoods. The substrate
measures MEAN |Y(x,y) - mean(Y, 3x3)| over skin-mask pixels — the
classic high-pass-vs-flat metric.
Math:
For each skin-mask pixel:
local_mean = sum of 3x3 luminance / 9
residual = |luminance - local_mean|
detail_score = sum(residual) / count(skin_pixels)
< 3 → SMOOTH_MANNEQUIN (no pores)
3..8 → MODERATE_TEXTURE (acceptable)
≥ 8 → DETAILED_NATURAL (visible pore-scale detail)
Output flat-array:
result[0] = pixel_count
result[1] = mean_residual
result[2] = max_residual
result[3] = pore_candidate_count (pixels with residual > 12)
result[4] = verdict
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_image.nx
imported by: nx_arousal_detail_test.nx
structs
| none |
consts
| 36 | const NX_PORE_RES_PIXELS: i64 = 0 |
| 37 | const NX_PORE_RES_MEAN_RES: i64 = 1 |
| 38 | const NX_PORE_RES_MAX_RES: i64 = 2 |
| 39 | const NX_PORE_RES_CANDIDATES: i64 = 3 |
| 40 | const NX_PORE_RES_VERDICT: i64 = 4 |
| 41 | const NX_PORE_RES_FIELDS: i64 = 5 |
| 43 | const NX_PORE_VERDICT_SMOOTH_MANNEQUIN: i64 = 0 |
| 44 | const NX_PORE_VERDICT_MODERATE_TEXTURE: i64 = 1 |
| 45 | const NX_PORE_VERDICT_DETAILED_NATURAL: i64 = 2 |
| 47 | const NX_PORE_THRESH_SMOOTH: i64 = 3 |
| 48 | const NX_PORE_THRESH_DETAILED: i64 = 8 |
| 49 | const NX_PORE_CANDIDATE_THRESH: i64 = 12 |
functions
| 52 | func nx_pore_local_mean(rgb: *Image, x: i64, y: i64) -> i64 |
| 70 | func nx_skin_pore_detail(rgb: *Image, skin_mask: *Image, result: *i64) -> i64 |