← Back to Projects
10

Real-Time Face Tracking

A computer-vision pipeline that detects faces and drives pan-tilt servos over serial to keep the subject centered at 30 FPS.

PythonOpenCVArduinoPan-Tilt ServosSerial

Status: Complete · 2025

~30 FPS
sustained on constrained hardware
The tracker holding a subject centered under pan-tilt control.

Problem and context

Detecting a face in a frame is a solved problem; keeping a physical camera pointed at one is not, because the loop has to close fast enough that the subject has not moved by the time the servos respond.

Constraints

The pipeline had to sustain a usable frame rate on constrained hardware while sharing time with serial communication, and the mechanics had to be driven without the servos hunting around the target.

Design and tradeoffs

Detection runs in Python with OpenCV, and positional error is streamed over serial to an Arduino that drives the pan-tilt mechanism. Splitting the work this way keeps vision on the host, where it belongs, and keeps servo timing on a microcontroller, where jitter is bounded. The cost is a serial link in the control loop, which is why the message format is kept minimal.

Results

A real-time tracking pipeline sustaining roughly 30 FPS on constrained hardware, holding the subject centered under live pan-tilt control.

Limitations and what is next

It tracks a face, not a specific person, and loses the target when the face turns far enough away from the camera. Adding a simple motion model would let it coast through brief detection dropouts instead of stopping.