nx_body_measurement_extract.nx
buildroot/runtime/nx_body_measurement_extract.nx
about
nx_body_measurement_extract.nx -- silhouette + scale -> BodyDimensions.
Closes the customer-facing side of the retail-fit pipeline. Customer
takes a body photo (or stands in front of any camera); substrate
extracts measurable dimensions in millimeters. Pairs directly with
nx_garment_fit_match for the substrate-grounded "Small" replacement.
PRIVACY NOTE: the substrate runs CLIENT-SIDE. Pixel data + measurements
stay on the customer's device. Only the verdict (PERFECT_TAILORED /
GOOD_FIT / etc. + recommended SKU rank) ships to the retailer's
server. No body-photo upload; no body-measurement leak. This is
the privacy-preserving inversion of the typical "send us your
measurements" e-commerce flow.
CONTRACT (V1):
silhouette binary mask (foreground=1, background=0); single
channel; same w x h as the original photo
reference_px pixels measured for the reference object's
long axis (e.g., card_long_axis_pixels)
reference_mm the reference's real-world long axis in mm
(credit card 85.6mm; A4 paper 297mm; etc.)
landmark_y[] caller-supplied landmark row indices:
[0] top_of_head (auto-detectable as
topmost foreground row)
[1] shoulder_y (~ head + 0.13 * height)
[2] bust_y (~ head + 0.25 * height)
[3] waist_y (~ head + 0.37 * height,
OR narrowest-cross-
section search range)
[4] hip_y (~ head + 0.50 * height)
[5] inseam_top_y (groin / crotch)
[6] ankle_y (auto-detectable as
bottommost foreground row)
out *BodyDimensions struct from nx_garment_fit_match
Future brick (queued): nx_body_landmark_detect.nx -- given silhouette,
emit landmark_y array automatically via anthropometric proportion
fitting + edge curvature. Until then, the caller provides them.
genealogy_id: iso_8559_1989_body_measure + heine_2012_anthropometry +
dependencies 4 imports · 2 importers
imports: nx_syscalls.nxnx_tier.nxnx_image.nxnx_garment_fit_match.nx
imported by: nx_body_measurement_extract_test.nxnx_garment_extract_measurements_test.nx
structs
| 74 | struct BodyExtractReport |
consts
| 55 | const NX_BME_Q: nx_int = 1024 |
| 58 | const NX_BME_LM_TOP_OF_HEAD: nx_int = 0 |
| 59 | const NX_BME_LM_SHOULDER: nx_int = 1 |
| 60 | const NX_BME_LM_BUST: nx_int = 2 |
| 61 | const NX_BME_LM_WAIST: nx_int = 3 |
| 62 | const NX_BME_LM_HIP: nx_int = 4 |
| 63 | const NX_BME_LM_INSEAM_TOP: nx_int = 5 |
| 64 | const NX_BME_LM_ANKLE: nx_int = 6 |
| 65 | const NX_BME_LM_COUNT: nx_int = 7 |
| 68 | const NX_BME_FIDELITY_HIGH: nx_int = 0 // tight reference, clean silhouette |
| 69 | const NX_BME_FIDELITY_MODERATE: nx_int = 1 |
| 70 | const NX_BME_FIDELITY_LOW: nx_int = 2 // silhouette holes / no reference |
| 71 | const NX_BME_FIDELITY_UNUSABLE: nx_int = 3 // refuse to claim measurements |
| 72 | const NX_BME_N_FIDELITY_BANDS: nx_int = 4 |
functions
| 87 | func _bme_width_at_row(sil: *Image, y: nx_int) -> nx_int |
| 108 | func _bme_silhouette_area(sil: *Image) -> nx_int |
| 129 | func nx_bme_narrowest_width_in_range(sil: *Image, |
| 147 | func nx_bme_widest_width_in_range(sil: *Image, |
| 162 | func _bme_px_to_mm(pixels: nx_int, scale_q10: nx_int) -> nx_int called by 1: nx_body_measurement_extract |
| 169 | func nx_body_measurement_extract( |
| 260 | func nx_body_measurement_fidelity_is_valid(b: nx_int) -> nx_int called by 1: main |
| 266 | func nx_body_measurement_landmark_is_valid(l: nx_int) -> nx_int called by 1: main |