kinect.enableUser(SimpleOpenNI.SKEL_PROFILE_ALL);

edited August 2015 in Kinect

I have face a problem while going to generate skeleton tracking. It come error message can not find anything named "SimpleOpenNI.SKEL_PROFILE_ALL" etc... I have import SimpleOpenNI but didn't work.

My code is shown bellow please give me a solution for my problem.

import SimpleOpenNI.*; SimpleOpenNI kinect;

public void setup() { kinect = new SimpleOpenNI(this); kinect.setMirror(true); kinect.enableDepth(); //--kinect.enableUser(SimpleOpenNI.SKEL_PROFILE_ALL); size(kinect.depthWidth(), kinect.depthHeight()); }

public void draw() { kinect.update(); image(kinect.depthImage(), 0, 0); if (kinect.isTrackingSkeleton(1)) { drawSkeleton(1); } }

void drawSkeleton(int userId) { pushStyle(); stroke(255,0,0); strokeWeight(3); kinect.drawLimb(userId, SimpleOpenNI.SKEL_HEAD, SimpleOpenNI.SKEL_NECK); kinect.drawLimb(userId, SimpleOpenNI.SKEL_NECK, SimpleOpenNI.SKEL_LEFT_SHOULDER); kinect.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_SHOULDER, SimpleOpenNI.SKEL_LEFT_ELBOW); kinect.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_ELBOW, SimpleOpenNI.SKEL_LEFT_HAND); kinect.drawLimb(userId, SimpleOpenNI.SKEL_NECK, SimpleOpenNI.SKEL_RIGHT_SHOULDER); kinect.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_SHOULDER, SimpleOpenNI.SKEL_RIGHT_ELBOW); kinect.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_ELBOW, SimpleOpenNI.SKEL_RIGHT_HAND); kinect.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_SHOULDER, SimpleOpenNI.SKEL_TORSO); kinect.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_SHOULDER, SimpleOpenNI.SKEL_TORSO); kinect.drawLimb(userId, SimpleOpenNI.SKEL_TORSO, SimpleOpenNI.SKEL_LEFT_HIP); kinect.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_HIP, SimpleOpenNI.SKEL_LEFT_KNEE); kinect.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_KNEE, SimpleOpenNI.SKEL_LEFT_FOOT); kinect.drawLimb(userId, SimpleOpenNI.SKEL_TORSO, SimpleOpenNI.SKEL_RIGHT_HIP); kinect.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_HIP, SimpleOpenNI.SKEL_RIGHT_KNEE); kinect.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_KNEE, SimpleOpenNI.SKEL_RIGHT_FOOT); popStyle(); }

public void onNewUser(int userId) { println("onNewUser - userId: " + userId); if (kinect.isTrackingSkeleton(1)) return; println(" start pose detection"); kinect.startPoseDetection("Psi", userId); }

public void onLostUser(int userId) { println("onLostUser - userId: " + userId); }

public void onStartPose(String pose, int userId) { println("onStartPose - userId: " + userId + ", pose: " + pose); println(" stop pose detection"); //--kinect.stopPoseDetection(userId); //--kinect.requestCalibrationSkeleton(userId, true); }

public void onEndPose(String pose, int userId) { println("onEndPose - userId: " + userId + ", pose: " + pose); }

public void onStartCalibration(int userId) { println("onStartCalibration - userId: " + userId); }

public void onEndCalibration(int userId, boolean successfull) { println("onEndCalibration - userId: " + userId + ", successfull: " + successfull);

if (successfull) { println(" User calibrated !!!"); kinect.startTrackingSkeleton(userId); }

else { println(" Failed to calibrate user !!!"); println(" Start pose detection"); //--kinect.startPoseDetection("Psi", userId); } }

Tagged:

Answers

  • You'll get a better response if you format your code. Here's how:

    http://forum.processing.org/two/discussion/8045/how-to-format-code-and-text

  • Sure, Above code for skeleton tracking. I get error message for following lines

    kinect.enableUser(SimpleOpenNI.SKEL_PROFILE_ALL);

    kinect.stopPoseDetection(userId);

    kinect.requestCalibrationSkeleton(userId, true); }

    kinect.startPoseDetection("Psi", userId); } }

    Error message give as cannot find name like SimpleOpenNI.SKEL_PROFILE_ALL etc...

    Is that a problem of SimpleOpenNI or else?

    How ever when I remove above command lines code is running but not in correctly I can't see skeleton tracking, only I can see black n white image, and no any other skeleton tracking?

Sign In or Register to comment.