O'Reilly logo

Making Things See by Greg Borenstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4

Save Calibration

Example A-3 presents a sketch that saves the calibration data into a file called calibration.skel in your sketch’s data folder. After you have calibrated, hit any key to save the file.

Example A-3. save_calibration.pde

import SimpleOpenNI.*; SimpleOpenNI kinect; int trackedUserID = 0; void setup() { size(640, 480); kinect = new SimpleOpenNI(this); // enable depthMap generation kinect.enableDepth(); // enable skeleton generation for all joints kinect.enableUser(SimpleOpenNI.SKEL_PROFILE_ALL); } void draw() { kinect.update(); image(kinect.depthImage(), 0, 0); IntVector userList = new IntVector(); kinect.getUsers(userList); if (userList.size() > 0) { int userId = userList.get(0); if (kinect.isTrackingSkeleton(userId)) { trackedUserID ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required