feat: print captured photos per detected frontal face

This commit is contained in:
2026-11-10 14:49:59 +01:00
parent 085a5e9cc0
commit 2e21946300
6 changed files with 43587 additions and 8 deletions

View File

@@ -21,3 +21,26 @@ Weights: https://media.githubusercontent.com/media/opencv/opencv_zoo/main/models
SHA-256: `db0898ae717b76b075d9bf563af315b29562e11f8df5027a1ef07b02bef6d81c`
`src/hand_pose.rs` rotates and crops the detected hand, requires at least 0.65 hand confidence, and checks all five fingers for extension using 3D landmarks. Finger extension tolerates natural curvature and a relaxed thumb while rejecting curled fingers and fists. Rejected poses reset the dwell/progress timer; the outline persists for up to 750 ms after the last accepted sample to avoid flicker. This verifies an open hand, not whether the palm side rather than the back faces the camera. Thresholds may need tuning for the camera and viewing distance.
# Capture face counting
The bundled `haarcascade_frontalface_alt2.xml` and
`haarcascade_eye_tree_eyeglasses.xml` are OpenCV Haar cascades from
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,
using a frontal-face cascade followed by a roughly level, centered pair of eyes.
Faces below 40 px and faces with closed/hidden eyes may be missed. This is a
conservative side-view filter, not an exact gaze estimator. OpenCV is limited to
two threads. Validate counts and timings with representative group photos on the
kiosk before deployment; no accuracy or latency guarantee is implied.
The current capture is the clean mirrored 640×480 camera frame, before overlays.
The app sends a JPEG to `lp -n COUNT -o fit-to-page` using the default CUPS printer
and its configured paper/media settings. Install the CUPS client (`lp`) and set
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.