cli: Add --debug-dump-dir for capture diagnostics
Diagnosing camera or face-detection failures from a hardware-only
trace ('confidence 0.231' or 'no face detected') is painful because
the actual frame data has already been thrown away by the time the
user sees the error. There's no way to tell whether the camera
captured a black frame, a wrong exposure, a frame of someone else's
face, or a perfectly fine frame that SCRFD just couldn't handle.
When `pareidolia enroll --debug-dump-dir <PATH>` is set, every
captured (post-conversion, pre-detection) frame is written to that
directory as a binary PPM file before the detector runs. The dump
fires regardless of detection outcome, so failed captures still
leave the frame on disk for inspection. Files are named
`rgb-{i}.ppm` and `ir-{i}.ppm` with 1-based sample indices.
PPM (P6) was chosen instead of PNG because the goal is debug
output, not distribution: no compression, no extra dependencies,
universal viewer support (feh, eog, ImageMagick, GIMP), and a hex
dump of the file is still meaningful if a viewer isn't handy. The
format is a three-line text header followed by raw RGB bytes.
# Pipeline runtime split
To dump the frame *before* face detection runs (so failed
detections still leave a frame), `pipeline_runtime::capture_one_face`
is decomposed into:
- `capture_rgb8(source)` — capture + RGB8 conversion only
- `embed_best_face(frame, detector, embedder)` — detect, align,
embed, pick highest-confidence face
`capture_one_face` itself remains as a thin wrapper composing the
two, so the `test` subcommand and any future single-shot callers
don't need to change. Enrollment switches to the two-step form so
the optional dump can sit between capture and detection.
# Scope
Behaviour is unchanged when the flag is absent — no extra disk
writes, no extra log lines, no change to enrollment storage. The
flag is documented as a debugging tool, not a production knob; the
daemon path (M5) won't expose it.