nx_garment_extract_measurements.nx
buildroot/runtime/nx_garment_extract_measurements.nx
about
nx_garment_extract_measurements.nx -- product photo -> GarmentDimensions.
Closes the RETAILER side of the lossless-sizing pipeline. Retailer
photographs each SKU with a reference object in frame (or beside it);
substrate extracts real bust/waist/hip/length/shoulder/sleeve/inseam
in millimeters. Eliminates the manual "type 36 measurements per
SKU" tax that's the chief reason apparel sizing data is so dirty
in the first place.
Pairs directly with nx_body_measurement_extract on the customer
side + nx_garment_fit_match for the verdict. All three primitives
use the same silhouette + reference-scale + caller-supplied
landmark-Y pattern; substrate doesn't pretend to detect landmarks
(that's a separate future primitive nx_garment_landmark_detect.nx).
CONTRACT (V1):
silhouette binary mask of the garment (background-removed)
reference_pixels pixel length of reference object's long axis
reference_mm real-world long axis in mm
landmark_y[] row indices: top / bust / waist / hip / hem /
sleeve_end / inseam_top
cut garment cut sealed-enum (NX_FIT_CUT_*) -- caller
knows the SKU's cut; substrate routes flattery
math accordingly
out *GarmentExtractReport carrying GarmentDimensions
genealogy_id: iso_8559_1989_body_measure + asbm_2017_apparel_grading +
ashdown_2007_sizing_systems
lineage_id: garment_measurement_extract_q10_mm
dependencies 4 imports · 1 importers
imports: nx_syscalls.nxnx_tier.nxnx_image.nxnx_garment_fit_match.nx
imported by: nx_garment_extract_measurements_test.nx
structs
| 61 | struct GarmentExtractReport |
consts
| 42 | const NX_GME_Q: nx_int = 1024 |
| 45 | const NX_GME_LM_TOP: nx_int = 0 // top of shoulder seam OR waistband |
| 46 | const NX_GME_LM_BUST: nx_int = 1 |
| 47 | const NX_GME_LM_WAIST: nx_int = 2 |
| 48 | const NX_GME_LM_HIP: nx_int = 3 |
| 49 | const NX_GME_LM_HEM: nx_int = 4 // bottom of garment |
| 50 | const NX_GME_LM_SLEEVE_END: nx_int = 5 // 0 if sleeveless |
| 51 | const NX_GME_LM_INSEAM_TOP: nx_int = 6 // 0 if not pants |
| 52 | const NX_GME_LM_COUNT: nx_int = 7 |
| 55 | const NX_GME_FIDELITY_HIGH: nx_int = 0 |
| 56 | const NX_GME_FIDELITY_MODERATE: nx_int = 1 |
| 57 | const NX_GME_FIDELITY_LOW: nx_int = 2 |
| 58 | const NX_GME_FIDELITY_UNUSABLE: nx_int = 3 |
| 59 | const NX_GME_N_FIDELITY_BANDS: nx_int = 4 |
functions
| 71 | func _gme_width_at_row(sil: *Image, y: nx_int) -> nx_int |
| 91 | func _gme_silhouette_area(sil: *Image) -> nx_int |
| 108 | func _gme_px_to_mm(pixels: nx_int, scale_q10: nx_int) -> nx_int called by 1: nx_garment_extract_measurements |
| 119 | func nx_gme_narrowest_width_in_range(sil: *Image, calls 1: _gme_width_at_row |
| 136 | func nx_gme_widest_width_in_range(sil: *Image, calls 1: _gme_width_at_row |
| 152 | func _gme_left_edge_at_row(sil: *Image, y: nx_int) -> nx_int calls 1: nx_image_get |
| 166 | func _gme_right_edge_at_row(sil: *Image, y: nx_int) -> nx_int calls 1: nx_image_get |
| 182 | func nx_garment_extract_measurements( |
| 280 | func nx_garment_extract_fidelity_is_valid(b: nx_int) -> nx_int called by 1: main |
| 286 | func nx_garment_extract_landmark_is_valid(l: nx_int) -> nx_int called by 1: main |