nx_blob.nx
buildroot/runtime/nx_blob.nx
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
imports: syscalls.nxnx_image.nxnx_presence.nx
imported by: nx_blob_gate.nxnx_skin_diag.nx
structs
| none |
consts
| 20 | const NX_BLOB_GRID: i64 = 32 |
functions
| 22 | func nx_blob_find(parent: *i64, x: i64) -> i64 |
| 29 | func nx_blob_union(parent: *i64, a: i64, b: i64) -> i64 |
| 36 | func nx_blob_largest(img: *Image, out: *i64) -> i64 |