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 ...
Get Making Things See now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.