./jerome{m}jack in

~/Labs/Voight-Kampff Lab.md · lab · 4 min · updated

Voight-Kampff Lab

2026 · Rust · WebAssembly · Computer Vision · DSP · ESPER sibling deck

« Capillary dilation of the so-called blush response. Fluctuation of the pupil. Involuntary dilation of the iris. »

Every beat of your heart pumps a tiny wave of blood through the capillaries under your skin, shifting green-channel reflectance by less than 0.5% — completely invisible to the human eye, yet sitting right there inside an ordinary webcam stream. The same goes for breathing chest heave, arterial neck pulsations, or a vibrating steel beam flexing by a third of a pixel.

The Voight-Kampff Lab is a real-time Eulerian Video Magnification and remote photoplethysmography (rPPG) optical telemetry workbench compiled from zero-dependency Rust to 116 KB of WebAssembly (voight.wasm) — no neural networks, no frameworks, and nothing ever uploaded. It opens immediately on four calibrated synthetic test specimens (a 72 BPM human baseline, a reactive Nexus-6 suspect, a 4.20 Hz sub-pixel vibrating cantilever beam, and a thoracic breathing subject) running through the exact same Rust pyramid and FFT pipelines as real hardware. Press arm camera to inspect your own live pulse and pupil dilation, or drop any local video file onto the CRT.

voight · liveSwitch specimens (01 Human 72, 02 Nexus-6, 03 Beam 4.2Hz, 04 Breath), drag the A/B split curtain or the amber SKIN and cyan OCULAR ROI boxes, administer Voight-Kampff empathy questions Q1–Q6 to watch real autonomic deltas, or press arm camera to measure your own heartbeat and micro-motions locally.open ↗

1. Eulerian Video Magnification in YIQ space

Rather than tracking individual features frame-to-frame (Lagrangian tracking), Eulerian Video Magnification (Wu et al., MIT CSAIL 2012) watches how intensity changes over time at every fixed pixel location across multiple spatial scales:

  1. 4-level Burt–Adelson Laplacian pyramid: Each 256×192 frame is converted into NTSC YIQ space and decomposed into spatial frequency bands (256×192 → 128×96 → 64×48 → 32×24 → 16×12) using separable 5-tap [1, 4, 6, 4, 1] / 16 reduction and exact zero-phase expansion kernels. Level 0 is left unamplified so raw webcam sensor noise never snowballs.
  2. Zero-flash 2nd-order Butterworth bandpass filter: Every spatial coefficient on levels 1–4 passes through a slow DC-anchored 2nd-order Butterworth bandpass biquad tuned live to [f_{\text{lo}}, f_{\text{hi}}]. Anchoring the DC baseline eliminates startup flashes and lets you sweep frequency bands live (for instance, isolating 0.15–0.65 Hz breathing vs. 0.75–3.0 Hz heartbeat vs. 2–8 Hz mechanical vibrations).
  3. Mode-aware spatial-wavelength damping: In pulse mode, coarse bands (L2–L4) receive high gain (\alpha = 40\times\text{–}100\times) to surface microvascular flush while spatially averaging out pixel noise. In motion mode, mid-frequency edge bands (L1–L3) follow Wu et al.’s linear Taylor stability ramp so sub-pixel edge displacements expand cleanly without blowing up into ringing artifacts.

Switch the monitor HUD between Optical, Flush Map (amber systolic surge vs. cyan diastolic recoil), Delta (pure temporal residual), Amber P3, and Raw, or drag the A/B Split curtain across the screen to compare raw vs. magnified pixels side by side.

2. Motion-robust heartbeat telemetry (POS rPPG)

Simply averaging green pixels works on a perfectly still subject, but breaks the instant you turn your head or room brightness drifts. voight.wasm implements POS (Plane-Orthogonal-to-Skin) (Wang et al., IEEE TBME 2017) alongside selectable CHROM, Green, and Optical Motion modes so you can compare them live:

  • Inside the draggable amber SKIN ROI, a YCbCr chroma gate isolates skin pixels and records their sliding 256-frame (R, G, B) history.
  • Over overlapping 1.6-second windows, channels are temporally normalized \tilde{C} = C/\bar{C} - 1 and projected onto two axes orthogonal to specular intensity changes:

S_1(t) = \tilde{G}(t) - \tilde{B}(t), \qquad S_2(t) = \tilde{G}(t) + \tilde{B}(t) - 2\tilde{R}(t)

h(t) = S_1(t) + \frac{\sigma(S_1)}{\sigma(S_2) + \varepsilon}\, S_2(t)

  • Overlap-adding h(t), linearly detrending, Hann-windowing, and running a zero-padded 512-point radix-2 FFT with parabolic peak interpolation recovers heart rate to ~0.3 BPM resolution, alongside spectral SNR (dB), beat-to-beat HRV (RMSSD ms), and low-frequency respiration rate (brpm).
  • In Motion mode (try Specimen 03 Beam 4.2Hz or drop a video of a vibrating object), the extractor switches to sub-pixel vertical luminance center-of-mass tracking — turning the workbench into a non-contact optical vibration tachometer up to 12 Hz.

3. Ocular iris monitor & Voight-Kampff protocol

The companion VK-09 Ocular Monitor crops a 96×64 region around the draggable cyan OCULAR ROI, suppresses bright corneal specular catchlights, segments the dark pupil core via adaptive percentile + radial centroid gating, and tracks relative pupil diameter (mm & Δ%), micro-saccade velocity (°/s), and blink rate (/min).

Administering questions Q1–Q6 (or typing your own prompt into VK >) drops vertical stimulus markers across the live scrolling chart and scores the 8-second post-stimulus autonomic delta (ΔBPM + ΔPupil) to classify the session — then exports a 1200×920 annotated Hard Copy PNG dossier.

Honest hardware limits

Real webcam biomedical optics obey physics, not Hollywood magic:

  1. Lighting matters most. Facing a steady window or desk lamp gives far higher SNR than dim backlighting. Strong 50/60 Hz LED PWM flicker or aggressive webcam auto-exposure can inject phantom peaks.
  2. Hold reasonably still for 5–8 seconds. POS cancels subtle head micro-motion, but large head turns or talking inside the Skin ROI temporarily lower spectral SNR — the status badge honestly drops to ACQUIRING rather than fabricating a reading.
  3. Not a medical device. This is a signal-processing instrument built to demonstrate Eulerian pyramids and optical rPPG in WebAssembly, never for clinical diagnosis.

More in Labs · sister Blade Runner deck in Esper Lab · sister sensing lab in Sonar Lab · browse Notes.