nx_pressure_deformation.nx
buildroot/runtime/nx_pressure_deformation.nx
about
nx_pressure_deformation.nx -- skin-on-skin contact tissue compression check.
Mannequin failure marker from image #45: hand cupping breast but the
breast tissue doesn't displace where the hand presses against it.
Real bodies show measurable compression at contact zones; mannequins
pass through each other or show rigid edges.
Math:
Given primary region bbox (breast) + contact region bbox (where
arm/hand crosses), the EXPECTED skin-mask area inside the contact
region is the primary region's local density × contact area.
Measured area / expected area = compression ratio.
< 0.7 ratio → strong compression (tissue displaced) NATURAL
0.7..0.85 → mild compression AMBIGUOUS
> 0.85 → little/no compression MANNEQUIN_RIGID
Also measure contact-boundary roughness: count skin-mask transitions
in horizontal slices through the contact band. Real flesh contacts
produce many transitions (wavy compression boundary); mannequins
produce a clean straight boundary.
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_image.nx
imported by: nx_pressure_deformation_test.nx
structs
| none |
consts
| 31 | const NX_MAGIC_1024: i64 = 1024 |
| 33 | const NX_PRESS_RES_PRIMARY_AREA: i64 = 0 |
| 34 | const NX_PRESS_RES_CONTACT_AREA: i64 = 1 |
| 35 | const NX_PRESS_RES_EXPECTED: i64 = 2 |
| 36 | const NX_PRESS_RES_COMPRESSION_Q10: i64 = 3 // measured/expected in Q10 |
| 37 | const NX_PRESS_RES_BOUNDARY_TRANS: i64 = 4 // total horizontal transitions |
| 38 | const NX_PRESS_RES_VERDICT: i64 = 5 |
| 39 | const NX_PRESS_RES_FIELDS: i64 = 6 |
| 41 | const NX_PRESS_VERDICT_MANNEQUIN_RIGID: i64 = 0 |
| 42 | const NX_PRESS_VERDICT_AMBIGUOUS: i64 = 1 |
| 43 | const NX_PRESS_VERDICT_NATURAL: i64 = 2 |
| 45 | const NX_PRESS_COMPRESS_NATURAL_Q10: i64 = 717 // ≤ 0.70 = natural |
| 46 | const NX_PRESS_COMPRESS_AMBIG_Q10: i64 = 870 // 0.70..0.85 = ambiguous |
functions
| 49 | func nx_press_count_in_bbox(mask: *Image, x0: i64, y0: i64, |
| 69 | func nx_press_count_transitions(mask: *Image, x0: i64, y0: i64, |
| 96 | func nx_pressure_deformation(mask: *Image, bbox: *i64, result: *i64) -> i64 |