RealityPaint

Projection mapping physical surfaces with art using a projector and Xbox Kinect

2024Computer VisionInteractiveGitHub

Overview

RealityPaint is an interactive projection mapping system that allows users to paint with light on physical surfaces. Using an Xbox Kinect for depth sensing and a projector for display, the system maps virtual artwork onto real-world geometry in real-time.

This was created as part of HackUMass in November 2024, where my team won third place overall.

How It Works

This is what we originally imagined:

  1. Depth Mapping: The Kinect scans the environment to create a 3D model of physical surfaces
  2. Homography: The projector and Kinect are calibrated to share the same coordinate space
  3. Interaction: Users can paint textures onto different geometries in the scene
  4. Projection: The artwork is projected onto the physical surfaces, conforming to their geometry

The result is artwork that appears to be painted directly onto walls, furniture, and other objects.

The Hardware

After struggling with geometry identification, we changed the concept behind the project last minute. Instead of geometry identification, the user can set a target depth and anything in front of this depth will be masked out of the projected art. One really great application of this technology is for presentations.

A user can stand in front of the projector and their figure is masked from the projected video. This allows for presentations with zero glare in the presenters eyes and zero overlap between the projection and the presenters body.

Technology

We had available to us all the major Kinect models: the Xbox 360 Kinect, the Xbox One Kinect, and the new Azure Kinect DK. We initially started with the new Azure Kinect DK, before realizing it is not compatible on macOS and there are currently no open-source drivers for it. Next, we went with the Xbox 360 Kinect, before realizing there wasn't a Python package for it or bindings available. We settled on the Xbox One Kinect, which had cross-platform support and open-source Python bindings on GitHub.

Getting a usable Kinect feed on modern Python turned out to be harder than expected. Existing bindings were broken or unmaintained, so we rewrote pykinect, a Python 3 fork of pyfreenect2, with better frame handling, depth registration, and BGRA output so the project could pull aligned color and depth frames without fighting the library.

Aligning the projector with the Kinect uses a homography. We project a known calibration image, photograph it with the Kinect, then match features between the two with SIFT and compute a perspective transform with OpenCV. That matrix maps between projector and camera space, so depth masks and textures can be warped onto the physical surface correctly.