nx_integral.nx
buildroot/runtime/nx_integral.nx
about
nx_integral.nx -- integral image (summed-area table). R-FACE-0: the
foundation of fast Haar-feature / Viola-Jones face detection. After an O(N)
build, the sum of ANY axis-aligned rectangle is O(1) via four lookups --
which is what makes a sliding-window cascade tractable.
SAT[y][x] (1-based, with a zero top row + left col) = sum of all pixels
strictly above-left. Rectangle [x0..x1] x [y0..y1] inclusive =
S = SAT[y1+1][x1+1] - SAT[y0][x1+1] - SAT[y1+1][x0] + SAT[y0][x0].
Pure i64. Operates on a 1-channel (grayscale) Image.
genealogy_id: crow_1984_summed_area_table + viola_jones_2001 (record-hint)
lineage_id: summed_area_table + o1_rectangle_sum
nx_safety_envelope:
intended_use: "Foundation for Haar features / face detection."
verdict: NOT_YET_EVALUATED
license_tier: ORIGINAL
dependencies 2 imports · 5 importers
imports: syscalls.nxnx_image.nx
imported by: nx_haar.nxnx_haar_cascade.nxnx_haar_cascade_gate.nxnx_haar_gate.nxnx_integral_gate.nx
structs
| 20 | struct IntegralImage |
consts
| 25 | const NX_II_BYTES: i64 = 24 |
functions
| 28 | func nx_integral_build(gray: *Image) -> *IntegralImage |
| 53 | func nx_integral_rect_sum(ii: *IntegralImage, x0: i64, y0: i64, x1: i64, y1: i64) -> i64 |