Tag

Mediapipe

2 articles tagged with "Mediapipe"

Real-time Face Tracking in Minecraft

Real-time Face Tracking in Minecraft

How Minecraft Webcam transforms your face into a blocky avatar.

The Concept

Your webcam sees your face. Minecraft Webcam tracks it and renders a Minecraft character that mirrors your expressions and head movements. The result: a Minecraft version of yourself, animated in real-time.

How Face Tracking Works

MediaPipe Face Mesh detects 468 facial landmarks at 30 FPS. From these landmarks, the system calculates:

  • Head pitch — Looking up/down (from nose position relative to eyes)
  • Head yaw — Looking left/right (from nose position relative to face center)
  • Head roll — Tilting (from line between eyes)
  • Blink detection — Eye aspect ratio from landmark distances
  • Mouth openness — Vertical distance between lip landmarks

Rendering the Avatar

Minecraft skins are 64x64 PNG files. The renderer:

Minecraft Webcam

Minecraft Webcam

Real-time face tracking that transforms your webcam feed into a Minecraft character with facial animations. Eyes blink when you blink, mouth opens when you talk.

Features

  • Real-time Face Tracking — 30 FPS with 468 facial landmarks via MediaPipe
  • Head Movement — Pitch (up/down), yaw (left/right), roll (tilt)
  • Facial Animations — Eyes blink automatically, mouth opens when talking
  • Custom Skins — Supports any standard Minecraft skin (64x64 format)
  • Animated Skin Support — Create custom facial expressions stored in unused texture space
  • Virtual Camera Output — Use the avatar in video calls or streaming (via OBS)
  • System Tray Integration — Runs minimized while active

Technical Highlights

  • MediaPipe Face Mesh — 468 3D facial landmarks
  • Minecraft Skin Parser — Exact specification compliance (64x32 and 64x64)
  • Perspective-correct rendering — Smooth 60 FPS UI updates
  • Unused texture space — Rows 32-40 store custom animations
  • Depth sorting — Painter’s algorithm for proper rendering order

Tech Stack

ComponentTechnology
Face TrackingMediaPipe Face Mesh
Image ProcessingOpenCV
GUITkinter
Virtual Camerapyvirtualcam
PlatformWindows

How It Works

  1. MediaPipe detects 468 facial landmarks at 30 FPS
  2. Head rotation calculated from nose and eye positions
  3. Minecraft skin texture mapped to 3D quad with perspective correction
  4. Avatar output sent to virtual camera for use in other apps