Face Landmark Alignment
Face landmarks pin sixty-eight points along eyes, brows, nose, and jaw so AR filters, gaze tracking, and face recognition align precisely.
Why Does This Exist?
A face box tells filters and recognizers where the face is but not where the eyes point or the mouth opens. Sixty-eight-point landmarks (Multi-PIE / 300-W convention: jaw , brows , nose , eyes , mouth ) convert the box into aligned geometry. Eye-aspect ratio from six eye points drives blink detection; five-point sparse sets align recognition embeddings; dense -point meshes (MediaPipe Face Mesh) anchor AR makeup.
Think of It Like This
Tent pegs before raising canvas
Pitching a tent starts with pegging corners and guylines, not draping canvas over grass. Landmarks are the pegs: eyes and jaw corners stake the face shape, then recognition and AR canvas stretches over them. A shifted peg wrinkles the whole tent.
Where it stops: pegs mark the surface, not the skull, so extreme expressions move pegs while identity stays put.
How It Actually Works
Classical cascaded regressors (dlib Kazemi-Sullivan, 2014) refine points from the box mean shape. Modern heads regress coordinates directly or predict heatmaps per point, trained with inter-ocular-normalized error (NME): mean point distance divided by eye-corner distance. Five percent NME is a solid operating point. Alignment warps faces to canonical eye positions before recognition.
Worked example
Eye corners at and : inter-ocular distance . Predicted nose tip off by : error . NME percent, poor. Refined prediction off by : error , NME percent, good. Eye-aspect ratio from vertical lid distances and over horizontal : open; below sustained reads as a blink.
Code
import math
# NME and eye-aspect ratio.nme = math.dist((103, 104), (100, 100)) / 50ear = (6 + 6) / (2 * 20)print(round(nme * 100, 1), round(ear, 2))# -> (10.0, 0.3)Watch Out For
Profile poses breaking 68-point models
Frontal-trained models hallucinate occluded cheek points past degrees yaw. Symptom: jawline sliding off the face. Fix: use pose-specific models or 3D-aware mesh heads for profile ranges.
Expression shift poisoning recognition
Smiling mouth points move while identity does not. Symptom: expression-sensitive mismatches. Fix: align on stable eye-nose anchors and prefer expression-robust embeddings downstream.
The Quick Version
- Sixty-eight points trace jaw, brows, nose, eyes, and mouth by convention.
- NME normalized by eye distance is the comparability metric.
- Five sparse points align recognition; dense meshes anchor AR.
- Eye-aspect ratio turns six lid points into blink detection.
- Profile yaw and heavy expression need specialized handling.