We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi guys, im new to processing and doing this project to controll some led lights through hand movement or gestures in kinect. okay so far i have managed to start kinect through processing and checked out some of the libraries, such as simpleopenNI, open kinect by shiffman (which is for mac only) arduino (firmata), dlibs_firnect(which is for windows http://forum.processing.org/one/topic/kinect-library-dlibs-freenect.html), kinect4winSDK.. since i am using a windows 7 64 bit machine, the open kinect will not work..right!! so here is the code i am running:
import SimpleOpenNI.*;
import processing.serial.*;
SimpleOpenNI kinect;
Serial myPort;
PVector handVec = new PVector();
PVector mapHandVec = new PVector();
color handPointCol = color(255,0,0);
void setup() {
kinect = new SimpleOpenNI(this);
// enable mirror
kinect.setMirror(true);
// enable depthMap generation, hands and gestures
kinect.enableDepth();
kinect.enableGesture();
kinect.enableHands();
// add focus gesture to initialise tracking
kinect.addGesture("Wave");
size(kinect.depthWidth(),kinect.depthHeight());
String portName = Serial.list()[0]; // This gets the first port on your computer.
myPort = new Serial(this, portName, 9600);
}
void onRecognizeGesture(String strGesture, PVector idPosition, PVector endPosition)
{
kinect.removeGesture(strGesture);
kinect.startTrackingHands(endPosition);
}
void onCreateHands(int handId, PVector pos, float time)
{
handVec = pos;
handPointCol = color(0, 255, 0);
}
void onUpdateHands(int handId, PVector pos, float time)
{
handVec = pos;
}
void draw() {
kinect.update();
kinect.convertRealWorldToProjective(handVec,mapHandVec);
image(kinect.depthImage(), 0, 0);
strokeWeight(10);
stroke(handPointCol);
point(mapHandVec.x, mapHandVec.y);
// Send a marker to indicate the beginning of the communication
myPort.write('S');
// Send the value of the mouse's x-position
myPort.write(int(255*mapHandVec.x/width));
// Send the value of the mouse's y-position
myPort.write(int(255*mapHandVec.y/height));
}
the error i get is, the function enablegesture() does not exist!!
can anyone of you tell me what the problem really is..is it the code or something wrong with the libraries?
thanks in advance
Answers
See To newcomers in this forum: read attentively these instructions, about choosing a category and formatting code.
Did that for you, for this one.