Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
kadambari.s
Website:
http://www.kadambarisahu.com
kadambari.s's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
how to get something behind the body in simpleopenni
[0 Replies]
22-May-2012 12:17 AM
Forum:
Contributed Library Questions
hey i have been playing arround with code of greg borenstein
i want to have a circle behind the head i have a code in which currently i get circle i front can any body help!!
import SimpleOpenNI.*;
import processing.opengl.*;
SimpleOpenNI kinect;
void setup() {
size(640,480);
kinect = new SimpleOpenNI(this);
kinect.enableDepth();
kinect.enableRGB();
// turn on user tracking
kinect.enableUser(SimpleOpenNI.SKEL_PROFILE_ALL);
// turn on depth-color alignment
kinect.alternativeViewPointDepthToImage();
//size(640, 480);
//fill(255,0,0);
}
void draw() {
kinect.update();
// PImage depth = kinect.depthImage();
//image(depth,0,0);
PImage rgbImage = kinect.rgbImage();
image(rgbImage,0,0);
// prepare the color pixels
rgbImage.loadPixels();
loadPixels();
// make a vector of ints to store the list of users
IntVector userList = new IntVector();
// write the list of detected users
// into our vector
kinect.getUsers(userList);
// if we found any users
if (userList.size() > 0) {
// get the first user
int userId = userList.get(0);
// if we're successfully calibrated
if ( kinect.isTrackingSkeleton(userId)) {
// make a vector to store the left head
PVector rightHead = new PVector();
// put the position of the left head into that vector
kinect.getJointPositionSkeleton(userId, SimpleOpenNI.SKEL_HEAD, rightHead);
// convert the detected head position
// to "projective" coordinates
// that will match the depth image
PVector convertedRightHead = new PVector();
kinect.convertRealWorldToProjective(rightHead, convertedRightHead);
// and display it
ellipse(convertedRightHead.x, convertedRightHead.y, 200, 200);
//translate(rightHead.x, rightHead.y, rightHead.z);
//ellipse(20, 20, 300, 300);
}
}
}
// user-tracking callbacks!
void onNewUser(int userId) {
println("start pose detection");
kinect.startPoseDetection("Psi", userId);
}
void onEndCalibration(int userId, boolean successful) {
if (successful) {
println(" User calibrated !!!");
kinect.startTrackingSkeleton(userId);
} else {
println(" Failed to calibrate user !!!");
kinect.startPoseDetection("Psi", userId);
}
}
void onStartPose(String pose, int userId) {
println("Started pose for user");
kinect.stopPoseDetection(userId);
kinect.requestCalibrationSkeleton(userId, true);
}
«Prev
Next »
Moderate user : kadambari.s
Forum