code wiki / (root) / nx_blob.nx

nx_blob.nx

buildroot/runtime/nx_blob.nx

5148 B148 linesdepth 6pulls 7 transitivereach 2 importersview sourcekind librarytopic blob
docsdependenciesstructsconstsfunctions

about

nx_blob.nx -- largest connected skin region (R2-refine). Fixes localization: a global skin bbox spans the whole frame when skin is everywhere; the LARGEST CONNECTED COMPONENT is the actual subject. Builds a GRIDxGRID occupancy map (cell = skin if >=50% of its pixels are skin), labels it with two-pass union-find connected-component labeling (4-connectivity), and returns the biggest component's cell count + grid bounding box + box area. Coarse grid (not per-pixel CCL) keeps it cheap and robust: a person is a coarse blob; scattered skin-coloured speckle never forms a big component. out[]: [0]=blob_cells [1..4]=grid bbox minx,miny,maxx,maxy [5]=bbox_cells [6]=total_occupied_cells [7]=grid genealogy_id: connected_component_labeling_union_find (record-hint) lineage_id: occupancy_grid + two_pass_ccl + largest_component license_tier: ORIGINAL

dependencies 3 imports · 2 importers

syscalls.nx nx_image.nx nx_presence.nx nx_blob.nx nx_blob_gate.nx nx_skin_diag.nx

imports: syscalls.nxnx_image.nxnx_presence.nx

imported by: nx_blob_gate.nxnx_skin_diag.nx

structs

none

consts

20const NX_BLOB_GRID: i64 = 32

functions

22func nx_blob_find(parent: *i64, x: i64) -> i64
29func nx_blob_union(parent: *i64, a: i64, b: i64) -> i64
called by 1: nx_blob_largest calls 1: nx_blob_find
36func nx_blob_largest(img: *Image, out: *i64) -> i64