Kernelin projects / Motion Guard

Camera analytics that see direction and speed, not just "something moved".

Block-matching motion estimation, the core of every video encoder: every 16×16 block is searched ±12 px in the previous frame, 576 million pixel comparisons per 720p frame. From the vectors: vehicle speed per lane, zones you can arm or ignore, and an event log. Plain Kotlin, compiled to WebGPU by Kernelin.

starting…
Click a zone to ignore it (e.g. the tree); ignored zones never raise events.

Lane speeds

Shown for the test camera (calibrated: a lane is 3.5 m).

Events

No events yet.
GPU, block matching per frame
–
incl. upload + read back
Frames per second (whole loop)
–
capture + GPU + analysis + draw
CPU, same Kotlin (Wasm, 1 thread)
–
press "Measure"
GPU speedup
–
same frame, same vectors
Accuracy vs ground truth
–
precision / recall, test camera

Why this matters

Fewer false alarms

Plain frame differencing alarms on swaying trees, rain and light changes. Motion vectors know direction and speed: leaves wiggle in place, cars travel. In the test scene the tree raises 0 false detections.

Speed and direction for free

The same vectors give vehicle speed per lane (here within 6% of the truth) and wrong-way detection: the analytics traffic departments buy dedicated hardware for.

Where the GPU is not optional

576 million comparisons per frame, 30 times a second, is 17 billion per second. One CPU core manages about one frame per second; the GPU keeps up with live video.

The code

loading…