Skip to content
KinPilot™Learn & Explore
Menu

Grades 6–8 · Computing

How can a face effect follow features without identifying a person?

Drawn glasses can stay on a face in a video even as the face moves across the screen. The effect has to keep finding where the glasses belong. It can do this by estimating the locations of facial features, without needing to know whose face it is. Locating features and recognizing a person's identity are different computational tasks.

A landmark is an estimated point associated with a feature, such as an eye corner or the tip of a nose. Modern systems can use a trained model to estimate many such points from an image. For a simple glasses effect, imagine that we already have two eye-center points. Their positions give three useful clues: where to center the glasses, how far to tilt them and how large to draw them.

Take invented eye points at (200,180) and (280,180). Their midpoint is (240,180), and their separation is 80 image units. A glasses drawing with lens anchors 80 units apart fits this level arrangement when its center is placed at that midpoint. If both eye points move 30 units to the right, the midpoint does too. The same translation moves both lens anchors into their new positions.

Tilting the face changes the direction of the line joining the eyes. Rotating the glasses by that same angle keeps their two anchors aligned with that line. If the eye separation also changes—for example, because the face appears larger in the image—the glasses need a matching scale change. Translation, rotation and scaling each answer a different part of the placement problem; changing one does not automatically solve the others.

The colored dots mark the same two lens anchors in each face view. The glasses move, tilt or grow with the landmark pair, while the midpoint remains between the eyes.

Translation, rotation and scale align a glasses effectInvented face views show two blue eye landmarks and an orange midpoint. The glasses first align with a horizontal pair, then translate thirty units right with the pair, then rotate twenty degrees around their midpoint. The final enlarged lens-anchor view increases separation and glasses size together. These are geometric landmarks rather than identity labels.Glasses follow landmark geometry1 Place the lens anchorsEye points: (200,180), (280,180)Midpoint: (240,180)2 Translate with the faceBoth points move 30 units right.3 Rotate with the eye lineThe two anchors keep their spacing.4 Scale with the separationWider points need a larger overlay.
Two eye landmarks set the glasses' center and direction. The successive invented views show translation, rotation and a larger scale. These are geometry examples, not images of identified people.

A real head can also turn away from the camera, making one side appear narrower or become hidden. A flat two-point construction cannot describe every such change. More complete systems estimate many landmarks, use three-dimensional geometry and decide which drawn parts should be hidden behind the face. Repeated estimates can wobble, so smoothing may make movement steadier at the cost of responding less quickly.

The effect is rebuilt as the images change. A missed or poorly placed landmark can make the glasses slide, which reveals the hidden dependency: the drawing follows the estimated geometry, not an understanding of who is wearing it. An effect can therefore track a moving face without an identity lookup, although landmark detection alone does not tell us everything about how a particular app handles its data.

About this explanation

Starting knowledge: Learners should read ordered coordinate pairs and understand midpoint, distance and the idea of rotation.

Sources

  • Google for Developers — Face landmark detection guide for Web
  • Google MediaPipe — Face Mesh: Face Geometry Module
← Grades 6–8 topics