nx_pose_classify.nx
buildroot/runtime/nx_pose_classify.nx
about
nx_pose_classify.nx -- classify body pose from face + torso geometry.
Heuristic geometric classifier — given face and torso bounding boxes
(already produced by nx_region), emit the most-likely pose enum that
drives nx_breast_drape_pose and other pose-aware detectors.
Decision tree:
1. Torso wider than tall (aspect < 1.0):
→ LAYING_BACK if face above torso center
→ FACE_DOWN_ASS_UP / ALL_FOURS otherwise
2. Face strongly offset horizontally from torso center:
→ SIDE_PROFILE if offset > 40% of torso width
→ RECLINING_TWISTED if offset 20..40%
3. Face above torso top with normal alignment:
→ STANDING_FACING (or LEANING_FORWARD if torso aspect very tall)
4. Face overlaps with torso vertically:
→ ARCHED_PRESENTING (bent / kneeling) if torso aspect 1..1.4
Pose enum values mirror nx_breast_drape_pose for direct routing.
Output flat-array (result[]):
result[0] = pose_enum
result[1] = confidence_q10 (0=guess, 1024=clear signal)
result[2] = torso_aspect_q10
result[3] = face_x_offset_from_torso_center_q10 (% of torso width)
result[4] = face_above_torso (0=overlap, 1=fully above)
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_multi_pair_test.nxnx_pair_synchrony.nxnx_pose_classify_test.nx
structs
| none |
consts
| 35 | const NX_MAGIC_1024: i64 = 1024 |
| 38 | const NX_POSE_UNKNOWN: i64 = 0 |
| 39 | const NX_POSE_STANDING_FACING: i64 = 1 |
| 40 | const NX_POSE_LEANING_FORWARD: i64 = 2 |
| 41 | const NX_POSE_LAYING_BACK: i64 = 3 |
| 42 | const NX_POSE_ARCHED_PRESENTING: i64 = 4 |
| 43 | const NX_POSE_RECLINING_TWISTED: i64 = 5 |
| 44 | const NX_POSE_SIDE_PROFILE: i64 = 6 |
| 45 | const NX_POSE_ALL_FOURS: i64 = 7 |
| 46 | const NX_POSE_FACE_DOWN_ASS_UP: i64 = 8 |
| 47 | const NX_POSE_KNEELING: i64 = 9 |
| 49 | const NX_POSE_RES_KIND: i64 = 0 |
| 50 | const NX_POSE_RES_CONFIDENCE: i64 = 1 |
| 51 | const NX_POSE_RES_TORSO_ASPECT: i64 = 2 |
| 52 | const NX_POSE_RES_X_OFFSET_PCT: i64 = 3 |
| 53 | const NX_POSE_RES_FACE_ABOVE: i64 = 4 |
| 54 | const NX_POSE_RES_FIELDS: i64 = 5 |
| 57 | const NX_POSE_LAY_ASPECT_MAX_Q10: i64 = 1024 // < 1.0 = wider than tall = laying |
| 58 | const NX_POSE_LEAN_ASPECT_MIN_Q10: i64 = 1638 // > 1.6 = very tall torso = leaning |
| 59 | const NX_POSE_TWIST_OFFSET_MIN_PCT: i64 = 20 // 20%+ horizontal face offset |
| 60 | const NX_POSE_PROFILE_OFFSET_MIN_PCT: i64 = 40 // 40%+ = side profile |
| 61 | const NX_POSE_ABOVE_GAP_MIN_PCT: i64 = 5 // face_y1 ≤ torso_y0 - 5% |
functions
| 66 | func nx_pose_classify(bbox: *i64, result: *i64) -> i64 called by 1: main |