code wiki / (root) / nx_body_measurement_extract.nx

nx_body_measurement_extract.nx

buildroot/runtime/nx_body_measurement_extract.nx

10639 B270 linesdepth 5pulls 7 transitivereach 2 importersview sourcekind librarytopic body
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_tier.nx nx_image.nx nx_garment_fit_match.nx nx_body_measurement_extract.nx nx_body_measurement_extract_test.n nx_garment_extract_measurements_te

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

74struct BodyExtractReport

consts

55const NX_BME_Q: nx_int = 1024
58const NX_BME_LM_TOP_OF_HEAD: nx_int = 0
59const NX_BME_LM_SHOULDER: nx_int = 1
60const NX_BME_LM_BUST: nx_int = 2
61const NX_BME_LM_WAIST: nx_int = 3
62const NX_BME_LM_HIP: nx_int = 4
63const NX_BME_LM_INSEAM_TOP: nx_int = 5
64const NX_BME_LM_ANKLE: nx_int = 6
65const NX_BME_LM_COUNT: nx_int = 7
68const NX_BME_FIDELITY_HIGH: nx_int = 0 // tight reference, clean silhouette
69const NX_BME_FIDELITY_MODERATE: nx_int = 1
70const NX_BME_FIDELITY_LOW: nx_int = 2 // silhouette holes / no reference
71const NX_BME_FIDELITY_UNUSABLE: nx_int = 3 // refuse to claim measurements
72const NX_BME_N_FIDELITY_BANDS: nx_int = 4

functions

87func _bme_width_at_row(sil: *Image, y: nx_int) -> nx_int
108func _bme_silhouette_area(sil: *Image) -> nx_int
129func nx_bme_narrowest_width_in_range(sil: *Image,
called by 1: main calls 1: _bme_width_at_row
147func nx_bme_widest_width_in_range(sil: *Image,
called by 1: main calls 1: _bme_width_at_row
162func _bme_px_to_mm(pixels: nx_int, scale_q10: nx_int) -> nx_int
169func nx_body_measurement_extract(
260func nx_body_measurement_fidelity_is_valid(b: nx_int) -> nx_int
called by 1: main
266func nx_body_measurement_landmark_is_valid(l: nx_int) -> nx_int
called by 1: main