Skip to main content

normalize

Function normalize 

Source
pub fn normalize(lum: &[f32; 16384]) -> Vec<f32>
Expand description

Zero-mean + unit-norm, with the spatial mean appended as a final dimension before scaling. The appended DC preserves absolute brightness: a uniform frame’s embedding is the pure DC direction instead of the zero vector, so flat bright fields (setup blue) and flat black (no signal) separate by construction rather than collapsing onto each other. Only the exactly-zero vector (uniform black: no variance AND no light) scores as nothing — that is the sole case callers short-circuit to Dark. Output length is EMBED_DIMS = GRID*GRID + 1.