code wiki / (root) / nx_pressure_deformation.nx

nx_pressure_deformation.nx

buildroot/runtime/nx_pressure_deformation.nx

5621 B144 linesdepth 5pulls 6 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_image.nx nx_pressure_deformation.nx nx_pressure_deformation_test.nx

imports: nx_syscalls.nxnx_image.nx

imported by: nx_pressure_deformation_test.nx

structs

none

consts

31const NX_MAGIC_1024: i64 = 1024
33const NX_PRESS_RES_PRIMARY_AREA: i64 = 0
34const NX_PRESS_RES_CONTACT_AREA: i64 = 1
35const NX_PRESS_RES_EXPECTED: i64 = 2
36const NX_PRESS_RES_COMPRESSION_Q10: i64 = 3 // measured/expected in Q10
37const NX_PRESS_RES_BOUNDARY_TRANS: i64 = 4 // total horizontal transitions
38const NX_PRESS_RES_VERDICT: i64 = 5
39const NX_PRESS_RES_FIELDS: i64 = 6
41const NX_PRESS_VERDICT_MANNEQUIN_RIGID: i64 = 0
42const NX_PRESS_VERDICT_AMBIGUOUS: i64 = 1
43const NX_PRESS_VERDICT_NATURAL: i64 = 2
45const NX_PRESS_COMPRESS_NATURAL_Q10: i64 = 717 // ≤ 0.70 = natural
46const NX_PRESS_COMPRESS_AMBIG_Q10: i64 = 870 // 0.70..0.85 = ambiguous

functions

49func nx_press_count_in_bbox(mask: *Image, x0: i64, y0: i64,
69func nx_press_count_transitions(mask: *Image, x0: i64, y0: i64,
96func nx_pressure_deformation(mask: *Image, bbox: *i64, result: *i64) -> i64