feat: show throttled live face detection rectangles

This commit is contained in:
2026-11-10 14:55:34 +01:00
parent 994c78cc26
commit 6437261a65
4 changed files with 116 additions and 14 deletions

View File

@@ -30,7 +30,8 @@ https://github.com/opencv/opencv/tree/4.6.0/data/haarcascades.
Each XML includes its upstream license notice. They are embedded in the binary;
no model downloads or external model paths are needed at runtime.
Detection runs once per capture, with the longest image edge capped at 640 px,
Detection runs once per capture and at most twice per second for the live preview,
with the longest image edge capped at 640 px,
using a frontal-face cascade with an optional eye-pair check. When fewer than two
eyes are detected, the frontal-face result is accepted: missing eyes are not
reliable evidence of a side view. When two or more eyes are detected, a roughly
@@ -47,3 +48,11 @@ up the default printer on the kiosk. Zero accepted faces means no print job;
detection/printing errors are logged without stopping the preview or retrying a
possibly submitted job. Debug logs include candidate boxes, eye counts, rejected
faces, accepted face/copy count, detection duration and CUPS submission result.
Live preview rectangles show every frontal-face candidate: green (`#84bf65`)
means accepted for printing; blue (`#4caee3`) means rejected by the eye-pair check.
Rectangles use mirrored camera coordinates and share the preview cover crop.
They are cached between samples and cleared by empty results or detection errors.
They never appear in detector inputs or the printed photo. Live sampling is quiet;
full per-face debug information is emitted for captures only. The preview is
sampled separately from capture, so counts can change with movement or lighting.