nx_segmenter_classical.nx
buildroot/runtime/nx_segmenter_classical.nx
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
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
structs
| 52 | struct NxSegBlob |
| 65 | struct NxSegResult |
consts
| 42 | const NX_MAGIC_1048576: i64 = 1048576 |
| 46 | const NX_SEG_MAX_DIM: nx_int = 8192 |
| 47 | const NX_SEG_MAX_BLOBS: nx_int = 65536 |
| 48 | const NX_SEG_MIN_BLOB_PIXELS: nx_int = 4 // drop noise specks |
| 61 | const NX_SEG_BLOB_BYTES: nx_size = 56 |
| 74 | const NX_SEG_RESULT_BYTES: nx_size = 48 |
| 78 | const NX_SEG_OK: nx_int = 0 |
| 79 | const NX_SEG_ERR_BAD_DIM: nx_int = 1 |
| 80 | const NX_SEG_ERR_OVERFLOW: nx_int = 2 |
functions
| 84 | func _seg_find_root(parent: *nx_int, x: nx_int) -> nx_int |
| 97 | func _seg_union(parent: *nx_int, a: nx_int, b: nx_int) -> nx_int |
| 116 | func nx_segmenter_connected( |
| 296 | func nx_segmenter_largest_blob(r: *NxSegResult) -> *NxSegBlob |
| 315 | func _seg_zero(buf: *nx_int, n: nx_int) -> nx_int called by 1: main |
| 324 | func _seg_fill_rect(mask: *nx_int, w: nx_int, called by 1: main |
| 338 | func main() -> nx_int |