code wiki / (root) / nx_garment_extract_measurements.nx

nx_garment_extract_measurements.nx

buildroot/runtime/nx_garment_extract_measurements.nx

9990 B290 linesdepth 5pulls 7 transitivereach 1 importersview sourcekind librarytopic garment
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_tier.nx nx_image.nx nx_garment_fit_match.nx nx_garment_extract_measurement nx_garment_extract_measurements_te

imports: nx_syscalls.nxnx_tier.nxnx_image.nxnx_garment_fit_match.nx

imported by: nx_garment_extract_measurements_test.nx

structs

61struct GarmentExtractReport

consts

42const NX_GME_Q: nx_int = 1024
45const NX_GME_LM_TOP: nx_int = 0 // top of shoulder seam OR waistband
46const NX_GME_LM_BUST: nx_int = 1
47const NX_GME_LM_WAIST: nx_int = 2
48const NX_GME_LM_HIP: nx_int = 3
49const NX_GME_LM_HEM: nx_int = 4 // bottom of garment
50const NX_GME_LM_SLEEVE_END: nx_int = 5 // 0 if sleeveless
51const NX_GME_LM_INSEAM_TOP: nx_int = 6 // 0 if not pants
52const NX_GME_LM_COUNT: nx_int = 7
55const NX_GME_FIDELITY_HIGH: nx_int = 0
56const NX_GME_FIDELITY_MODERATE: nx_int = 1
57const NX_GME_FIDELITY_LOW: nx_int = 2
58const NX_GME_FIDELITY_UNUSABLE: nx_int = 3
59const NX_GME_N_FIDELITY_BANDS: nx_int = 4

functions

71func _gme_width_at_row(sil: *Image, y: nx_int) -> nx_int
91func _gme_silhouette_area(sil: *Image) -> nx_int
108func _gme_px_to_mm(pixels: nx_int, scale_q10: nx_int) -> nx_int
119func nx_gme_narrowest_width_in_range(sil: *Image,
136func nx_gme_widest_width_in_range(sil: *Image,
152func _gme_left_edge_at_row(sil: *Image, y: nx_int) -> nx_int
calls 1: nx_image_get
166func _gme_right_edge_at_row(sil: *Image, y: nx_int) -> nx_int
calls 1: nx_image_get
182func nx_garment_extract_measurements(
280func nx_garment_extract_fidelity_is_valid(b: nx_int) -> nx_int
called by 1: main
286func nx_garment_extract_landmark_is_valid(l: nx_int) -> nx_int
called by 1: main