Skip to content
openFrameworks addon for calibrating a Kinect to a projector for real-time projection mapping onto moving surfaces
C++ C Objective-C Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
calibration Use native multi window code instead of ofxSecondWindow Nov 16, 2015
calibration_openni updated xcodeproj to 0.9 Nov 11, 2015
example_contourMap updated xcodeproj to 0.9 Nov 11, 2015
example_contourMap_openni updated xcodeproj to 0.9 Nov 11, 2015
src made openni calibration module and examples May 20, 2015
LICENSE Initial commit Jun 6, 2014 note about openni config folders May 20, 2015


This is an openFrameworks addon for calibrating a projector to a Kinect, allowing for automated projection mapping aligned to the Kinect.

This toolkit is also implemented as a Processing library. It is based on the method described by Jan Hrdlička. ofxKinectProjectorToolkit is similar in aim to ofxCamaraLucida, ofxReprojection, and ofxProjectorKinectCalibration.


This library and the included calibration app can be coupled with either ofxKinect or ofxOpenNI, and have several dependencies

If using ofxOpenNi, make sure to copy the openni config/lib folders into the data path as described in its README, or you will get compilation errors (they are not included in the example files found here).



Set your display settings to dual-screen so the projector has its own display, and launch the calibration example (or calibration_openni if using ofxOpenNi).

Make note of the screen resolution of the projector's display (e.g. 1280x800) and copy to PROJECTOR_RESOLUTION_X and PROJECTOR_RESOLUTION_Y.

Follow the instructions in the calibration app to collect a series of point pairs by moving the chessboard to various positions and recording point pairs, and save the calibration file.


The post-calibration example_contourMap and example_contourMap_openni demonstrate how to apply the calibration. They reproject solid colors onto the objects found and tracked from the kinect using ofxCv's contourFinder, which tracks blobs frame to frame, though persistent identification is not 100% reliable.

Make sure you load the calibration file you saved in the previous step in the line:


The key function for mapping is getProjectedPoint(ofVec3f worldPoint). This function takes any 3d world point from the Kinect and converts it to a pixel point. For example, using ofxKinect, the pixel point associated with the world point inside the depth image at (x, y) is found:

ofVec3f worldPoint = kinect.getWorldCoordinateAt(x, y);
ofVec2f projectorPoint = kpt.getProjectedPoint(worldPoint);

Using ofxOpenNi, the world point is acquired slightly differently, directly from the raw depth pixels.

ofShortPixels depthPixels = kinect.getDepthRawPixels();
ofPoint depthPoint = ofPoint(x, y, depthPixels[x +y * kinect.getWidth()]);
ofVec3f worldPoint = kinect.projectiveToWorld(depthPoint);
ofVec2f projectedPoint = kpt.getProjectedPoint(worldPoint);
You can’t perform that action at this time.