code wiki / (root) / nx_segmenter_classical.nx

nx_segmenter_classical.nx

buildroot/runtime/nx_segmenter_classical.nx

14005 B412 linesdepth 3pulls 3 transitivereach 7 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_segmenter_classical.nx -- classical-CV connected-component segmenter. CAPABILITY_COMPLETENESS: PARTIAL MISSING_CAPABILITIES: - face landmark detection (eye / nose / mouth keypoints): queued (needs trained classifier or Haar cascade); blocks per-region phrasing like "blob 0 is the face" - hand-specific segmentation (palm + fingers separated from wrist): nx_segmenter_classical returns generic skin blobs; downstream nx_hand_skeleton (queued) would post-process - anatomical region naming (wrist / inside-elbow / etc.): queued; needs pose estimator or landmark detector COVERED: - Generic binary-mask connected-component labeling (4-connectivity, union-find for label merging in 2 passes) - Per-blob bounding box + pixel count - Skin-mask integration: caller may use nx_color_skin_mask output as input, or any other binary mask - Sealed-enum blob-classification by shape proxies (queued as v2; v1 returns just geometry) This primitive unblocks region-based tier-axis graders by providing the SEGMENTATION INPUT they need. After this ships, the v0 composer can promote axes from PENDING_SEGMENTATION to OK for any region the grader can be invoked with explicit bounding-box bounds (vein-signal in a wrist bbox; subsurface in a fingertip bbox; etc.). genealogy_id: rosenfeld_1966_connected_components lineage_id: nx_segmenter_classical_v1

dependencies 3 imports · 4 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_segmenter_classical.nx nx_image_grade_v1.nx nx_image_grade_v2.nx nx_landmark_anatomy.nx nx_silhouette_integrity.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nx

imported by: nx_image_grade_v1.nxnx_image_grade_v2.nxnx_landmark_anatomy.nxnx_silhouette_integrity.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap _seg_zero nx_segmenter_connected sys_mmap ↻ _seg_union _seg_find_root _seg_find_root ↻ _seg_fill_rect nx_segmenter_largest_blob

structs

52struct NxSegBlob
65struct NxSegResult

consts

42const NX_MAGIC_1048576: i64 = 1048576
46const NX_SEG_MAX_DIM: nx_int = 8192
47const NX_SEG_MAX_BLOBS: nx_int = 65536
48const NX_SEG_MIN_BLOB_PIXELS: nx_int = 4 // drop noise specks
61const NX_SEG_BLOB_BYTES: nx_size = 56
74const NX_SEG_RESULT_BYTES: nx_size = 48
78const NX_SEG_OK: nx_int = 0
79const NX_SEG_ERR_BAD_DIM: nx_int = 1
80const NX_SEG_ERR_OVERFLOW: nx_int = 2

functions

84func _seg_find_root(parent: *nx_int, x: nx_int) -> nx_int
97func _seg_union(parent: *nx_int, a: nx_int, b: nx_int) -> nx_int
116func nx_segmenter_connected(
296func nx_segmenter_largest_blob(r: *NxSegResult) -> *NxSegBlob
315func _seg_zero(buf: *nx_int, n: nx_int) -> nx_int
called by 1: main
324func _seg_fill_rect(mask: *nx_int, w: nx_int,
called by 1: main
338func main() -> nx_int